摘要:
function Queue(){ //这里是属性和方法 var items=[];//用数组的方法去存储数据 this.enqueue=function(element){ items.push(element); };//入列 ... 阅读全文
摘要:
function Stack(){ //各种方法和属性的声明 var items=[];//用数组来保存栈里的元素 this.push=function(element){ items.push(element); };//将数据压到栈顶 ... 阅读全文