线性时间选择之TOP-K问题(分治算法) 用快速排序的思想,结合随即划分方法 直接上代码 #include <stdio.h> #include <stdlib.h> #include <time.h> #include <utility> int partition(int * array, int start, int end) { int comp = array[start]; while (start < end) { while (array[end] >= comp && start < end) { end--; } if (array