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

📄 list.h

📁 Astar windows版本 Astar windows版本
💻 H
字号:
#pragma once
#include "list.h"
#include <iostream>
using namespace std;
template <class Type> class List;
template <class Type> class Node
{
	Type contents;
	Node * next;
	friend List<Type>;
};
template <class Type> class List
{
public:
	List();
	~List();
	bool IsEmpty() const {return (pHead==NULL) ? true : false;}//判断链表是否为空
	int Length() const {return length;} //返回链表中的元素总数
	bool Find(int k, Type & intnum) const; //寻找链表中的第k个元素,并将其传送至intnum
	int Search(const Type & intnum) const; //寻找intnum,如果发现intnum,则返回intnum的位置,如果intnum不在链表中,则返回0
	void Delete(int k, Type & intnum); //把第k个元素取至intnum,然后从链表中删除第k个元素
	void Insert(int k, const Type &intnum); //在第k个元素之后插入intnum
	void Modify(int k,const Type &intum);//将第k个元素的值修改为intnum
	void ShowListNode(); //显示输出链表的所有数据
private:
	Node<Type> *pHead;
	int length;
};

⌨️ 快捷键说明

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