数据结构设计:
const int MAXSIZE = 20;//线性表大小
typedef int position;//设置别名代表的当前位置
struct LNode//结构体定义
{
int Data[MAXSIZE];//线性表大小
position last;//当前位置
};
typedef struct LNode* List;//用List代替struct LNode*
接口设计:
List makeEmpty() ;//初始化
position Find(int k, const List& L);//查询元素,返回元素位置
bool Insert(const List& L, int pos, int k);//在pos处插入k值
bool Delete(const List& L, int pos);//删除pos位置的元素
void Print(const List& L);//打印线性表
接口实现代码:
//初始化
List makeEmpty() {
List L;
L = (List)malloc(