标签:style blog class code c java
void quickSort(int *a1 , int *a2){ int i=0 , j=a2-a1-1; if (i>=j) return; swap(a1[0] , a1[rand()%j+1]); while( i<j ){ while(i<j && a1[i]<=a1[0]) ++i; while(a1[j]>a1[0]) --j; if(i<j) swap(a1[i] , a1[j]); } swap(a1[0],a1[j]); quickSort(a1 ,a1+j); quickSort(a1+j+1,a2); }
标签:style blog class code c java
原文地址:http://www.cnblogs.com/hanwuhu/p/3732249.html