首页>
外国专利>
Quicksort which uses the average of the values in a sub-array as the pivot to sort that sub array
Quicksort which uses the average of the values in a sub-array as the pivot to sort that sub array
展开▼
机译:Quicksort,它使用子数组中值的平均值作为对子数组进行排序的关键
展开▼
页面导航
摘要
著录项
相似文献
摘要
The algorithm picks a pivot value and moves all the data values, which are less than the pivot, to the start of the array and all those values, which are larger than the pivot, to the end of the array. The algorithm is then applied recursively to the sub-array of numbers less than the pivot value and to the sub-array of numbers greater than the pivot value. During the initial sorting pass, the count and sum of the numbers less than the pivot and the count and the sum of the values greater than the pivot are calculated. These are then used to calculate the mean of the values less than the pivot and the mean of the values greater than the pivot. These values are then used as the pivot values for the next level of the recursive sort. A different algorithm may be used for sorting small arrays or sub-arrays.
展开▼