llist.h

来自「判断链表中是否有循环 有的话」· C头文件 代码 · 共 21 行

H
21
字号
#include "Node.h"
#include <iostream>
using namespace std;
//////链表类//////////
class LList{
private:
	Node *tail;
	Node *fence;
	void init(){							//初始化
	 head = tail = fence = new Node();
	}
public:
	Node *head;
	LList(){init();}
	bool append(int elem);					//追加元素
	bool circleInList();					//判断是否循环
	void print();							//打印一次循环元素
	void setTail(Node *temp) {				//构造循环
	tail->next = temp;
	}
};

⌨️ 快捷键说明

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