首页 > 试题广场 >

对顺序表L作快速排序

[填空题]
对顺序表L作快速排序
void QSort(SqList *L,int low,int high)
 { /* 对顺序表L中的子序列L.r[low..high]作快速排序。算法10.7 */
   int pivotloc;
   if(        1        )
   { /* 长度大于1 */
     pivotloc=Partition(L,low,high); /* 将L.r[low..high]一分为二 */
             2        /* 对低子表递归排序,pivotloc是枢轴位置 */
             3        /* 对高子表递归排序 */
   }
 }
 void QuickSort(SqList *L)
 { /* 对顺序表L作快速排序*/
   QSort(L,1,(*L).length);
 }

这道题你会答吗?花几分钟告诉大家答案吧!