*** Filename:Mystack.java
Associated java files: TreeGUI.java, NodeGUI.java,
TwoThreetree.java
Compiler : JDK 1.1.4
*** °ú ¸ñ : ÈÀÏ󸮷Ð
*** ´ã´ç±³¼ö : ¹Ú¿µ¹è
*** ¸íÁö´ëÇб³ ÄÄÇ»ÅͰøÇаú 3Çг⠹ÎÁ¤½Ä
*** E-Mail : mxxk@uriel.net
*** Execute on(Refe. to) http://www.uriel.net/~mxxk/File/btree.html
*** **********************************************************************/
public class Mystack {
int ele[];
int top;
public Mystack(int size) {
ele = new int[size];
top = -1;
}
public int pop() {
return ele[top--];
}
public void push(int key) {
ele[++top] = key;
}
public void clear() {
for(int i = 0; i < ele.length; i++)
ele[i] = 0;
top = -1;
}
public boolean empty() {
if (top == -1)
return true;
else
return false;
}
}