实现循环队列的基本操作(初始化、判断队空、判断队满、入队、出队)

[复制链接]
查看11 | 回复2 | 2017-9-20 18:42:43 | 显示全部楼层 |阅读模式
/*
实现循环队列的基本操作(初始化、判断队空、判断队满、入队、出队) */ //在javascript中,可以使用数组来实现一个队列 function stack(){
this.datastore = new Array();
//初始化
this.isEmpty = isEmpty; //判断队空
this.isFull = isFull; //判断队满
this.add = add;
//入队
this.remove = remove; //出队
this.count = 0;
function isEmpty(){
回复

使用道具 举报

千问 | 2017-9-20 18:42:43 | 显示全部楼层
templateclass SqQueue{ Telem*elem; int front,rear; int len; public:SqQueue(int maxsz=100):len(maxsz){ elem=new Telem[len]; front=rear=0;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行