void quicksort(int a[], int left, int right)
{
if (left < right)
{
int low = left;
int high = right;
int key = a[left];
while (low < high)
{
while (low < high && a[high] > key)
high--;
a[low] = a[high];
while (low < high && a[low] < key)
low++;
a[high] = a[low];
}
a[low] = key;
quicksort(a[], left, low-1);
quicksort(a[], low+1, right);
}
}
阅读(531) | 评论(0) | 转发(0) |