快速排序
int quick_sort (int *data, int left, int right) {
if (left > right) {
return 1;
}
int pivot = data[left], low = left, high = right;
while (low < high) {
while (low < high && data[high] >= pivot) {
high--;
}
data[low] = data[high];
while (low < high && data[low] <= pivot) {
low++;
}
data[high] = data[low];
}
data[low] = pivot;
quick_sort(data, left, low - 1);
quick_sort(data, low + 1, right);
}