queue.cpp

来自「一个可执行的nbc算法设计与实现 有助大家互相探讨学习」· C++ 代码 · 共 49 行

CPP
49
字号
#include "stdafx.h"
#include "queue.h"


QNode *queue::GetHead()
{
	return front;
}

void queue::Del_Queue()
{
	QNode *TNd;
	TNd=front;
	front=front->next;
	delete TNd;
	
}

void queue::Insert_Queue(line *L)
{
  QNode *Nd=new QNode;
  Nd->po=L;
  Nd->next=NULL;
  if(front==NULL)
  {
	 front=Nd;
	 rear=Nd;
  }
  else
  {
	  rear->next=Nd;
	  rear=Nd;
  }	
}


int queue::Que_Empty()
{
	if(front==NULL)
		return 1;
	else
		return 0;
}


void queue::Que_Reset()
{
	front=rear=NULL;
}

⌨️ 快捷键说明

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