Status ListCreate_Sq(SqList &L) {
//初始化L为一个空的有序顺序表
L.elem = (ElemType *)malloc(LIST_INIT_SIZE * sizeof(ElemType));
if (!L.elem)
exit(OVERFLOW);
L.listsize = LIST_INIT_SIZE; //顺序表的容量
L.length = 0; //顺序表的元素个数
int n = 0;
scanf("%d",&n);
for (int i=0;i<n;i++) {
scanf("%d",&(L.elem[i]));
L.length ++;
}
return OK;
}
void ListReverse_Sq(SqList &L) {
for (int i=0;i<L.length/2;i++) {
ElemType tmp = L.elem[i];
L.elem[i] = L.elem[L.length-1-i];
L.elem[L.length-1-i] = tmp;
}
}