//一趟快速排序算法
{ int i=l; j=h; R[
while(i<j)
{ while(i<j && R[j]
if (i<j) R[i] = R[j];
while(i<j && R[i]
if (i<j) R[j] = R[i];
}//while
R[i]=R[
return i;
}//Partition
int Partition(RecType K[]
{ //交換記錄子序列K[l
//此時
int i=l; j=n; K[
while(i<j)
{ while(i<j && K[i]
if (i<j) K[j]=K[i];
while(i<j && K[j]
if (i<j) K[i]=K[j];
}//while
K[i]=K[
}//Partition
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/23177.html