顺序表和链表的声明
顺序表:
第一种:使用malloc
#define MAXSIZE 100 //线性表最大长度为100
typedef struct node {
ElemType data; //数据类型
int length; //顺序表长度
}SqList;
int main(){
SqList list;
list.data=(ElemType *)malloc(MAXSIZE*sizeof(ElemType));
}
第二种
#define MAXSIZE 100
struct Sq