定义队列类模板queue(先进先出),队列的大小由使用者确定。要求该类模板对外提供如下二种基本操作:(1)inser(入队列)(2)front(出队列),用数组来实现
#include ﹤ iostream ﹥
using namespace std;
template ﹤ class T, int size ﹥
class queue {
T x [ size ] ;
int current, front, rear;
public:
queue ( ) { current = 0; front = 0; rear = 0;}
....insert(....);
....front(....);
};
请写出两个函数的过程(如果需要形式参数,请给出形参类型和数量,以及返回值类型)
订单号:
遇到问题请联系在线客服
订单号:
遇到问题请联系在线客服