数据结构--数据结构中的双链表结构的测试

  • 双链表测试:test.c:
cs 复制代码
#include"List.h"

void ListTest01()
{
	//LTNode* plist = NULL;
	//LTInit(&plist);
	LTNode* plist = LTInit();

	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPrint(plist);

	LTNode* find = LTFind(plist, 3);
	//LTInsert(find, 66);
	LTErase(find);
	find = NULL;

	LTPrint(plist);
	LTDesTroy(plist);
	//plist = NULL;
	

	//if (find == NULL)
	//{
	//	printf("找不到!\n");
	//}
	//else {
	//	printf("找到了!\n");
	//}

	//LTPushFront(plist, 1);
	//LTPrint(plist);
	//LTPushFront(plist, 2);
	//LTPrint(plist);
	//LTPushFront(plist, 3);
	// 
	//
	测试尾删
	//LTPopBack(plist);
	//LTPrint(plist);
	//LTPopBack(plist);
	//LTPrint(plist);
	//LTPopBack(plist);
	//LTPrint(plist);

	测试头删
	//LTPopFront(plist);
	//LTPrint(plist);
	//LTPopFront(plist);
	//LTPrint(plist);
	//LTPopFront(plist);
	//LTPrint(plist);
	//LTPopBack(plist);
	//LTPrint(plist);
}

int main()
{
	ListTest01();
	return 0;
}

结合前面的两章内容,才是一个完整的双链表的创建和实现。

相关推荐
点云SLAM5 分钟前
PyTorch 中.backward() 详解使用
人工智能·pytorch·python·深度学习·算法·机器学习·机器人
only-qi34 分钟前
146. LRU 缓存
java·算法·缓存
悟能不能悟35 分钟前
js闭包问题
开发语言·前端·javascript
秋秋_瑶瑶40 分钟前
vue-amap组件呈现的效果图如何截图
前端·javascript·vue-amap
潼心1412o1 小时前
C语言(长期更新)第15讲 指针详解(五):习题实战
c语言·开发语言
xuxie132 小时前
SpringBoot文件下载(多文件以zip形式,单文件格式不变)
java·spring boot·后端
重生成为编程大王2 小时前
Java中的多态有什么用?
java·后端
梁辰兴2 小时前
数据结构:排序
数据结构·算法·排序算法·c·插入排序·排序·交换排序
666和7772 小时前
Struts2 工作总结
java·数据库