list.cpp

来自「实现了图的主要操作:(1)分别用邻接矩阵和邻接表实现图的基本操作(包括图的广度和」· C++ 代码 · 共 31 行

CPP
31
字号
/*#include "list.h"

template<class Elem>
bool mylist<Elem> :: insert(const Elem & E)
{
	fence->next = new Link<Elem> (E,fence->next);
	if(tail == fence) tail = fence->next;
	rightcnt++;
	return true;
}

template <class Elem>
bool mylist<Elem> :: append(const Elem & E)
{
	tail = tail->next = new Link<Elem> (E,NULL);
	rightcnt++;
	return true;
}

template <class Elem>  
bool mylist<Elem> :: remove(Elem & it)
{
	if(fence->next == NULL) return false;
	it = fence->next->element;
	Link<Elem> * tmp = fence->next;
	if(tail == tmp) tail = fence;
	delete tmp;
	return true;
}

*/

⌨️ 快捷键说明

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