llist.h

来自「判断链表是否相交 若相交」· C头文件 代码 · 共 25 行

H
25
字号
#include "Node.h"
#include <iostream>
using namespace std;
//////link/////////
class LList{
private:
	Node *head;
	void init(){							//initial the link
	 head = tail = fence = new Node();
	 length = 0;
	}
public:
	int length;
	Node *fence;	
	Node *tail;
	LList(){init();}
	bool append(int elem);					//add element in the last
	void setTail(Node *temp) {				//reset the tail ,make it intersect
	tail->next = temp;
	}
	int setEnd() {
		while(tail->next!=NULL){tail = tail->next;length++;}
		return length;
	}
};

⌨️ 快捷键说明

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