|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include "sqlist.cpp"
{ SqList *L;
printf("初始化L\n");
InitList(L); printf("ListEmpty(L)=%d\n",ListEmpty(L));
printf("L的位置1插入元素1\n"); ListInsert(L,1,1);
printf("L的位置2插入元素3\n"); ListInsert(L,2,3);
printf("L的位置3插入元素1\n"); ListInsert(L,3,1);
printf("L的位置4插入元素4\n"); ListInsert(L,4,4);
printf("L的位置5插入元素2\n"); ListInsert(L,5,2);
printf("L: "); DispList(L);
printf("ListLength(L)=%d\n",ListLength(L));
printf("ListEmpty(L)=%d\n",ListEmpty(L));
int e;
GetElem(L,3,e);
printf("L的第3个元素:%d\n",e);
printf("第1个值为1的元素的逻辑序号:%d\n",LocateElem(L,1));
printf("L的位置4插入元素5\n"); ListInsert(L,4,5);
printf("L: "); DispList(L);
printf("删除第3个元素\n");
ListDelete(L,3,e);
printf("L: "); DispList(L);
printf("销毁L\n");
DestroyList(L);
}
主函数还能改成什么,求大佬救助
|
|