标签:
快排。。。。
void quicksort(int *a,int left,int right){ if(left >= right){ return ; } int i = left; int j = right; int key = a[left]; while(i < j) { while(i < j && key <= a[j]){ j--; } a[i] = a[j]; while(i < j && key >= a[i]){ i++; } a[j] = a[i]; } a[i] = key; quicksort(a, left, i - 1); quicksort(a, i + 1, right); }
标签:
原文地址:http://www.cnblogs.com/zhangyifang/p/5394314.html