📄 vertexstack.cpp
字号:
// VertexStack.cpp: implementation of the CVertexStack class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "CollegeWizard.h"
#include "VertexStack.h"
#include "Vertex.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CVertexStack::CVertexStack()
{
list = NULL;
}
CVertexStack::~CVertexStack()
{
struct node* temp = list;
while(temp)
{
list = list->next;
delete temp;
temp = list;
}
}
//////////////////////////////////////////////////////////////////////
CVertex* CVertexStack::Pop()
{
struct node* temp = list;
if(list)
{
list = list->next;
return temp->vertex;
delete temp;
}
else return NULL;
}
void CVertexStack::Push(CVertex *vertex1)
{
struct node* temp = new node;
temp->next = list;
temp->vertex = vertex1;
list = temp;
}
BOOL CVertexStack::IsEmpty()
{
return list == NULL? TRUE : FALSE;
}
//////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -