顺序表的类型定义
#define MAXSIZE 100
typedef struct{
ElemType *elem;
int length;
}SqList; //顺序表类型
L.elem=(ElemType*)malloc(sizeof(ElemType)*MAXSIZE);
1.线性表L的初始化(参数用引用)
Status InitList_Sq(SqList &L){
//构造一个空的顺序表
L.elem=new ElemType[MAXSIZE]; //为顺序表分配空间
if (!L.elem) exit(OVERFLOW); //存储分配失败
L.length=0; //空表长度为0
return OK;
2.销毁线性表L
vo