标签:art oid return 等于 value quic 快速 ++ quick
int partition(int*a, int left, int right){
int low;
if (left < right){
low = left;
int high = right;
int value = a[left];
while (low < high){
while (low < high&&a[high] >= value) high--;
a[low] = a[high];
while (low < high&&a[low] <= value) low++;
a[high] = a[low];
a[low] = value;
}
}
return low;
}
void quicksort(int* a, int left, int right){
if (left < right){
int mid = partition(a, left, right);
quicksort(a, left, mid - 1);
quicksort(a, mid + 1, right);
}
}
left<right不能加等于。
标签:art oid return 等于 value quic 快速 ++ quick
原文地址:https://www.cnblogs.com/liangyc/p/11647106.html