文件名称: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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.