int Partition(int*list,int i,int j) { int pivot=list[i];//1 //2 while (i<j) { while (i<j&&list[j]>=pivot) j--; if(i<j) list[i++]=list[j]; while (i<j&&list[i]<=pivot) i++; list[j--]=list[i]; } //3 list[i]=pivot; return i; } void QuickSort(int* list, int low, int high) { int pivotPos;//1 if (low<high) { pivotPos=Partition(list,low,high);//2 QuickSort(list, low, pivotPos-1);//3 QuickSort(list, pivotPos+1, high); } }