void qSort(int a[], int l, int r)
{
if(l < r){
int i = l, j = r, temp = a[l];
while(i < j){
while(i < j && a[j] >= temp) j--;
if(i < j) a[i++] = a[j];
while(i < j && a[i] <= temp)i++;
if(i < j) a[j--] = a[i];
}
a[i] = temp;
qSort(a, l, i-1);
qSort(a, i+1, r);
}
}
快排C
猜你喜欢
转载自blog.csdn.net/qq_37720915/article/details/87975447
今日推荐
周排行