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

📄 main.cpp

📁 异质链表 的实现 实现异质链表的查找、插入、删除和遍历
💻 CPP
字号:

#include "HeterList.h"
#include "IntNode.h"
#include "FloatNode.h"
#include "StringNode.h"
#include "iostream.h"

int main(int args,char* argv[])
{
	CHeterList List;
	List.AddNode(new CIntNode(1) );
	List.AddNode(new CFloatNode((float)2.01));
	List.AddNode(new CFloatNode(2));
	List.AddNode(new CStringNode("hello"));
	List.VisitAllNode();
	bool find=List.FindNode(CIntNode(2));
	if(find)
		cout << "find int 2 ok" << endl;
	else
		cout << "find int 2 failed" << endl;
	find=List.FindNode(CFloatNode(2));
	if(find)
		cout << "find float 2 ok" << endl;
	else
		cout << "find float 2 failed" << endl;

	List.DeleteNode(CFloatNode((float)2.01));
	List.VisitAllNode();
	List.DeleteNode(CIntNode(1));
	List.VisitAllNode();
	return 0;
}

⌨️ 快捷键说明

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