📄 intlist.h
字号:
#include "stdafx.h"
#include "Node.h"
class Linklist
{
private:
Node *first,*last,*current,*prior;
public:
void MakeEmpty();//置空表
Linklist();
~Linklist(){MakeEmpty(); delete first;}
void Initialize(){current = last = first;prior = NULL;}//当表为空表时使指针复位
bool IsEmpty();
int Getdata();
int *Get();//返回当前节点的数据域的地址
bool Put(int &value);//改变当前节点的data,使其为value
int *GetNext();//返回当前节点的下一个节点的数据域的地址,不改变current
void Next();//移动current到下一个节点
void InsertBack(int &value);//在当前节点的后面插入节点,改变current
void InsertBefore(int &value);//在当前节点的前面插入一节点,不改变current,改变prior
bool Locate(int i);//移动current到第i个节点
void First(); //移动current到表头
void End();//移动current到表尾
void Remove();//删除当前节点,current指向下一个节点,如果current在表尾,执行后current = NULL
void CreatListH(int n=10); //头插法
void CreatListR(int n=10); //尾插法
void Swaplist(); //倒置链表
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -