private int top;
public SeqStack(int capacity) {
}
public SeqStack()
{this(10);
}
回true
return this.top__== -1________; } public boolean push(E element){ //元素element 入栈,若public boolean isEmpty(){ //判断栈是否为空,若空栈返this.value=new Object[Math.abs(capacity)]; this.top=-1; 操作成功返回true
if(element==null) return __false_______; if(this.top==value.length-1){ Object[] temp =this.value; this.value=new Object[temp.length*2]; for(int i=0;i<temp.length;i++) this.value[i]=temp[i];}
this.top___++_______;
this.value[this.top]=___element________; return ___true_____; }}
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库数据结构(java)复习题及答案(5)在线全文阅读。
相关推荐: