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

📄 llist.cpp

📁 设计一个类库
💻 CPP
字号:
#include"llist.h"

bool LList::insert(Record& item){
	fence->next = new Link(item, fence, fence->next);
	if( fence->next->next != NULL)
		fence->next->next->prev = fence->next;
	if( tail == fence)
		tail = fence->next;
	rightcnt++;
	return true;
}

bool LList::append(Record& item){
	tail = tail->next = new Link(item,tail,NULL);
	rightcnt++;
	return true;
}

bool LList::remove(Record& it){
	if (fence->next == NULL)
		return false;
	it = fence->next->rec;
	Link* ltemp = fence->next;
	if( ltemp->next != NULL)
		ltemp->next->prev = fence;
	else tail = fence;
	fence->next = ltemp->next;
	delete ltemp;
	rightcnt--;
	return true;
}

void LList::prev(){
	if( fence != head){
		fence = fence->prev;
		leftcnt--;
		rightcnt++;
	}
}

⌨️ 快捷键说明

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