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

  • 双链表测试: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;
}

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

相关推荐
GIS之路13 分钟前
ArcGIS Pro 中的 notebook 初识
前端
JavaGuide23 分钟前
7 道 RAG 基础概念知识点/面试题总结
前端·后端
桦说编程34 分钟前
从 ForkJoinPool 的 Compensate 看并发框架的线程补偿思想
java·后端·源码阅读
ssshooter1 小时前
看完就懂 useSyncExternalStore
前端·javascript·react.js
格砸1 小时前
从入门到辞职|从ChatGPT到OpenClaw,跟上智能时代的进化
前端·人工智能·后端
Live000002 小时前
在鸿蒙中使用 Repeat 渲染嵌套列表,修改内层列表的一个元素,页面不会更新
前端·javascript·react native
柳杉2 小时前
使用Ai从零开发智慧水利态势感知大屏(开源)
前端·javascript·数据可视化
躺平大鹅2 小时前
Java面向对象入门(类与对象,新手秒懂)
java