void quickSort(int a[], int low, int high)
{
if( low >= high)
{
return;
}
int i = low;
int j = high;
int key = a[i];
while(i < j)
{
while( i < j && a[j] >= key)
j--;
a[i] = a[j];
while( i < j && a[i] <= key )
i++;
a[j] = a[i];
}
a[i] = key;
quickSort(a,low,i-1);
quickSort(a,i+1,high);
}
quickSort
最新推荐文章于 2024-05-14 10:51:55 发布