📄 queue.cpp
字号:
#include "queue.h"HQueue::HQueue(int sz):rear(0),front(0),m(sz){//tag(0),//structure function,to create a empty Queue that have the max size of m Q =new Circle[m]; //create Queue space Q_ASSERT (Q != 0 ); //if(Q==0) //return; //assert:if the alloc storage succeed }void HQueue::EnQueue(Circle& item){//insert function //assert(!IsFull()); Q_ASSERT(!IsFull()); rear = (rear + 1) % m; // Q[rear] = item; // //tag = 1; }Circle HQueue::DeQueue(){// //assert(!IsEmpty()); Q_ASSERT(!IsEmpty()); front = (front + 1) % m; // //tag = 0; // return Q[front]; }Circle HQueue::GetFront(){// Q_ASSERT(!IsEmpty()); // return Q[(front + 1) % m] ; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -