阅读背景:

在快速排序算法中找到一个巧妙的支点

来源:互联网 

So I'm trying to implement a type of quicksort where instead of picking a random pivot, it picks a clever pivot each time. To do this it splits the array into groups of 5 and then sorts and finds the median of each group then takes all the medians found and finds the median of medians which will be the pivot. In theory the algorithm is supposed to have a O(n) running time. Here's what I have right now. The size of the array is defined by left and right.So I'm trying to implement a type of quicksort




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: