1、SqList.h
#ifndef SQLIST_H
#define SQLIST_H
#define MAXSIZE 20 // 存储空间初始分配量
typedef int ElemType; // ElemType类型根据实际情况而定,这里假设为 int
typedef struct
{
ElemType data[MAXSIZE]; // 数组存储数据元素,最大值为MAXSIZE
int length; // 线性表当前长度
}SqList;
#endif
2、InitList.h
#ifndef INITLIST_H
#define INITLIST_H
#include "SqList.h"
#include "GetElem.h"
// 初始化操作,建立一个空的线性表L
Status InitList(SqList *L)
{
L->length = 0;
return OK;
}
#endif
3、ListInsert.h
#ifndef LISTINSERT_H
#define LISTINSERT_H
#include "SqList.h"
#in