Combine QuickSort and Median selection algorithm

前端 未结 4 707
隐瞒了意图╮
隐瞒了意图╮ 2021-01-25 15:18

I want to modify QuickSort (in Java) so that every time Partition is called, the median of the proportioned array is used as the pivot.

I have a median selection algorit

4条回答
  •  [愿得一人]
    2021-01-25 16:20

    The standard way to get the median is to sort the data. And you want to sort the data by partitioning on the median. This seems very chicken and egg to me.

    Could you elaborate on why you want to partition/pivot on the median?

提交回复
热议问题