void quick_sort(int x[], int low, int high)
{
int i=low, j=high;
int t=x[low];
while (i<j)
{
while (i<j && x[j]>t)
j--;
x[i]=x[j];
while (i<j && x[i]<=t)
i++;
x[j]=x[i];
x[i] = t;
quick_sort(x,low,i-1);
quick_sort(x,i+1,high);
}
无意中发现这个快速排序的算法,简洁,高效! 初学者适合学习!