queue.cpp
来自「操作系统——页面置换算法」· C++ 代码 · 共 41 行
CPP
41 行
// Queue.cpp: implementation of the Queue class.
//
//////////////////////////////////////////////////////////////////////
#include"Queue.h"
Queue::Queue()
{
head=new process(0,0);
length=0;
tail=head;
}
void Queue::insert(process* pro)
{
tail->next=pro;
pro->prior=tail;
pro->next=NULL;
tail=pro;
}
process* Queue::pop()
{
process * pivot=head->next;
head->next=pivot->next;
return pivot;
}
void Queue::delq(process* p)
{
p->prior->next=p->next;
if(p->next)
p->next->prior=p->prior;
// delete
}
Queue::~Queue()
{
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?