本文共 601 字,大约阅读时间需要 2 分钟。
#includeusing namespace std;void printArray(int *arr, int size){ for(int i=0; i = pivot ) { high--; } array[low] = array[high]; // printArray(array, 7); } array[low] = pivot; // cout<<"pos:"< < pos - low + 1) { return selectK(array, high, pos+1, K-(pos-low+1)); }else{ return selectK(array, pos-1, low, K); }}int main(){ int array[7] = { 10, -22, 211, 120, -2, 23, 120}; int size = sizeof (array) / sizeof (*array); printArray(array, size); cout<<"number:"<
转载地址:http://wecii.baihongyu.com/