⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exam2-1.cpp

📁 数据结构(李春葆)书中第二章链表运算的所有源代码。包括链表的各种基本运算
💻 CPP
字号:
#include "sqlist.cpp"   /*假设线性表以顺序表表示*/
void main()
{
	SqList *L;
	ElemType e;
	InitList(L);
	ListInsert(L,1,'a');
	ListInsert(L,2,'c');
	ListInsert(L,3,'a');
	ListInsert(L,4,'d');
	ListInsert(L,5,'b');
	printf("ListLength(L)=%d\n",ListLength(L));
	printf("ListEmpty(L)=%d\n",ListEmpty(L));
	GetElem(L,3,e);
	printf("e=%c\n",e);
	printf("LocateElem(L,'a')=%d\n",LocateElem(L,'a'));
	ListInsert(L,4,'e');
	DispList(L);
	ListDelete(L,3,e);
	DispList(L);
	DestroyList(L);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -