int quciksort(int a[],int left,int right) { if(left>=right || a==NULL) return; int i=left; int j=right; int tmp = a[left];//任选一个作为标尺 while(i!=j) { while(a[j]>=tmp && i<j) j--; while(a[i]<=tmp && i<j) i++; if(i<j) { swap(a[i],a[j]); } } //标尺归位 a[left] = a[i]; a[i] = tmp; return i; }
资料:http://developer.51cto.com/art/201403/430986.htm
http://baishi.baidu.com/watch/8840635721980127142.html?&recFrom=site&list=1&&page=videoMultiNeed