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

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

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

相关推荐
bu_shuo4 分钟前
计算机二级学习-查找和排序
学习·算法·排序算法
happyprince5 分钟前
12-vLLM 量化方案全面分析
前端·javascript·vllm
大圣编程7 分钟前
python break语句
开发语言·前端·python
漂亮的摩托12 分钟前
如何编写一个SpringBoot项目告警推送的Starter
java·spring boot·后端
盖伦暴打诺手18 分钟前
类比推理知识点
java
ch.ju20 分钟前
Java程序设计(第3版)第四章——类加载
java·开发语言
河阿里21 分钟前
SLF4J深度指南(Java):从原理到 Spring 项目实战
java·开发语言·spring
小沈同学呀24 分钟前
飞书机器人+Spring AI Function Calling实战-扔掉MCP Client让LLM直接操控工具
java·开发语言·functioncalling·spring ai·飞书机器人
Sam092725 分钟前
【AI 算法精讲 13】朴素贝叶斯:文本分类的基石
人工智能·python·算法·ai
EntyIU27 分钟前
Vue History 模式配置文档
前端·javascript·vue.js