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

📄 queue.cpp

📁 一些自己做的关于图象处理的程序(如傅立叶变换
💻 CPP
字号:
// Queue.cpp: implementation of the CQueue class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "photostar.h"
#include "Queue.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

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

CQueue::CQueue()
{

}

CQueue::~CQueue()
{

}

BOOL CQueue::DeQueue(int &e)
{
	if (front==rear)
	{
		return FALSE;
	}
	QueuePtr p=front->next;
	e=p->data;
	front->next=p->next;
	if (rear==p)
	{
		rear=front;
	}
	free(p);
	return TRUE;
}

void CQueue::EnQueue(int e)
{
	QueuePtr p=new QNode;
	p->data=e;
	p->next=NULL;
	rear->next=p;
	rear=p;
	return;
}

void CQueue::DestroyQueue()
{
	while (front)
	{
		rear=front->next;
		delete front;
		front=rear;
	}
	return;
}

void CQueue::InitQueue()
{
	front = rear = new QNode;
	front->next = NULL;
	
	return;
}

⌨️ 快捷键说明

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