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

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

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

相关推荐
业精于勤的牙12 小时前
浅谈:算法中的斐波那契数(二)
算法·职场和发展
陈天伟教授12 小时前
人工智能训练师认证教程(2)Python os入门教程
前端·数据库·python
陈文锦丫12 小时前
MQ的学习
java·开发语言
乌暮12 小时前
JavaEE初阶---线程安全问题
java·java-ee
爱笑的眼睛1112 小时前
GraphQL:从数据查询到应用架构的范式演进
java·人工智能·python·ai
不穿格子的程序员12 小时前
从零开始写算法——链表篇4:删除链表的倒数第 N 个结点 + 两两交换链表中的节点
数据结构·算法·链表
liuyao_xianhui12 小时前
寻找峰值--优选算法(二分查找法)
算法
dragoooon3412 小时前
[hot100 NO.19~24]
数据结构·算法
Seven9713 小时前
剑指offer-52、正则表达式匹配
java
信看13 小时前
NMEA-GNSS-RTK 定位html小工具
前端·javascript·html