void List_to_Array(int a[],int len,SqList* L, SqList* L1){
int j = 0;
int i = 0;
for(i=0;i<20;i++){
if(i<L->length)
a[i]=L->data[i];
if(i>=L->length && j<L1->length)
a[i]=L1->data[j++];
}
}
void Reverse(int a[],int l, int r){
int mid = (l+r)/2;
for(int i = 0; i < mid;i++){
int temp = a[i];
a[l+i] = a[r-i];
a[r-i] = temp;
}
}
void exchange(int a[], int m, int n){
Reverse(a,0,m+n-1);
Reverse(a,0,n-1);
Reverse(a,n,m+n-1);
}
考研 线性表 王道第8题
最新推荐文章于 2021-04-23 23:01:09 发布