文件名称:stack-to-queue
介绍说明--下载内容均来自于网络,请自行研究使用
用二个顺序存储结构的栈,通过这二个栈的相关运算实现队列的以下功能。
Queue() //构造函数
bool empty() //返回队列是否已空
bool full() //返回队列是否已满
int serve() //出队列,成功返回0,否则返回-1
int append(const string &item) //item进队列,成功返回0,否则返回-1
int retrieve(string &item) const //将队列头的值赋给item,成功返回0,否则返回-1
-Storage structure with two sequential stack, two stack through which the relevant operations to achieve the following functions queue. Queue () // constructor bool empty () // Returns whether the queue is empty bool full () // returned to the queue is full int serve () // the queue, return 0 if successful, otherwise-1 int append (const string & item) // item into the queue, return 0 if successful, otherwise returns-1 int retrieve (string & item) const // assign the value of the head of the queue item, return 0 if successful, otherwise-1
Queue() //构造函数
bool empty() //返回队列是否已空
bool full() //返回队列是否已满
int serve() //出队列,成功返回0,否则返回-1
int append(const string &item) //item进队列,成功返回0,否则返回-1
int retrieve(string &item) const //将队列头的值赋给item,成功返回0,否则返回-1
-Storage structure with two sequential stack, two stack through which the relevant operations to achieve the following functions queue. Queue () // constructor bool empty () // Returns whether the queue is empty bool full () // returned to the queue is full int serve () // the queue, return 0 if successful, otherwise-1 int append (const string & item) // item into the queue, return 0 if successful, otherwise returns-1 int retrieve (string & item) const // assign the value of the head of the queue item, return 0 if successful, otherwise-1
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Ex2.cpp