标签:style blog color io ar div amp log
public void quicksort(int[] array, int low, int high){ int i = low; int j = high; if(i>j) return; int pivot = i + (j-i)/2; int pnum = array[pivot]; while(i<=j){ // array[i] == pnum error. because have to be swap. while(i<=j && array[i]<pnum) i++; while(i<=j && array[j]>pnum) j--; if(i<=j){ exchange(array,i,j); i++; j--; } } // Recursion quicksort(array,low, j); quicksort(array,i, high); }
标签:style blog color io ar div amp log
原文地址:http://www.cnblogs.com/leetcode/p/3889253.html