排序算法之快速排序

//QuickSort 快速排序 void QuickSort(int A[],int low,int high) { int i=low,j=high; int temp; if(low<high) { temp=A[low]; while(i!=j) { while(j>i && A[j]>temp) j--; if(i<j) { A[i]=A[j]; i++; } while(i<j && A[i]<temp) i++; if(i<j) { A[j]=A[i]; j--; } } A[i]=temp; QuickSort(A,low,i-1); QuickSort(A,i+1,high); } } 

你可能感兴趣的:(排序算法之快速排序)