📄 clinkedlist.h
字号:
#ifndef NULL
#define NULL 0
#endif
#include "stdio.h"
// 数据节点数据结构
template <class T>
class Node
{
public:
T data;
Node * next;
public:
void SetNext(Node<T> *);
Node<T> * GetNext();
T GetData();
};
// 注意:链表元素下标从1开始,0号位置为链表的头,链表头是不装数据的
template <class T>
class CLinkedList
{
private:
Node<T> * head;
Node<T> * tail;
protected:
bool CreateLinkedList();
bool DestoryLinkedList();
public:
CLinkedList();
~CLinkedList();
T GetElement(int);
bool AddElement(Node<T> *);
bool InsertElement(Node<T> *,int);
int GetLinkedListLength();
bool DeleteElement(int);
bool DeleteAll();
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -