list.cpp

来自「这是帮那留学生做的第二个作业,里面有详细的文档资料,要求运用到 链表 图 和最短」· C++ 代码 · 共 39 行

CPP
39
字号
// list.cpp: implementation of the list class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "list.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

list::list()
{
	hand=NULL;
	cur=NULL;
}

list::~list()
{
	connection *p=hand;
	while(p!=NULL){
		hand=hand->next;
		delete p;
		p=hand;
	}
}

void list::insert(connection *item)
{
	if(hand==NULL){
		hand=item;
		cur=item;
	}
	else{
		cur->next=item;
		cur=item;
	}
}
		

⌨️ 快捷键说明

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