pta6-1 快速排序
给一个无序表,使用快速排序算法对它进行排序。 函数接口定义: int Partition(SqList &L,int low,int high); void QuickSort(SqList &L, int low, int high); 其中L是待排序表,low和high是排序的区间。 裁判测试程序样例: # include <iostream> using namespace std ; # define MAXSIZE 50 typedef int KeyType ; typedef struct { KeyType key ; } ElemType ; typedef struct { ElemType r [ MAXSIZE + 1 ] ; int length ; } SqList ; void Create ( SqList & L ) { int i ; cin >> L . length ; for ( i = 1 ; i <= L . length ; i ++ ) cin >> L . r [ i ] . key ; } void Output ( SqList L ) { int i ; for ( i = 1 ; i <= L . length ; i ++ ) cout << L . r [ i ] . key << " " ; cout << endl