快速排序(递归)

#include 
using namespace std;
#define  MAXSIZE  20        
typedef struct{
    int key;
    char *otherinfo;
}ElemType;                        
typedef struct{
    ElemType *r;                                 
    int  length;                                
}SqList;                                        
int Partition(SqList &L,int low,int high){ 
    int pivotkey;
    L.r[0]=L.r[low];                    
    pivotkey=L.r[low].key;                       
    while(low=pivotkey) --high;
        L.r[low]=L.r[high];                
        while(low>n;                                        
    cout<<"待排序的数据:"; 
    for(i=1;i<=n;i++){
        cin>>L.r[i].key;
        L.length++;
    }
}
void show(SqList L){
    int i;
    for(i=1;i<=L.length;i++)
        cout<

image

你可能感兴趣的:(数据结构,c++)