function Queue(){ this.dataStore=[]; this.enqueue=enqueue; this.dequeue=dequeue; this.front=front; this.back=back; this.toString=toString; this.empty=empty; }
function enqueue(element){ this.dataStore.push(element);//利用数组的push方法 }
function deequeue(){ return this.dataStore.shift(); }
function front(){ return this.dataStore[0]; }
function back(){ return this.dataStore[this.dataStore.length-1]; }
function toString(){ var retStr=""; for(var i=0;i1.6 empty:判断对列是否为空function empty(){ if(this.dataStore.length==0){ rerturn true; }else{ return false; } }
如对本文有疑问, 点击进行留言回复!!
轻松解决 org.apache.taglibs.standard.tlv.JstlCoreTLV 困惑
vert实践五——Json?Protocol Buffer?FlatBuffers?
[基于tensorflow的人脸检测] 基于神经网络的人脸检测8——验证训练好的神经网络
selenium + ajax抓取英雄联盟全部英雄的详细信息及多线程保存全部皮肤图片到本地
网友评论