Constructor and Description |
---|
Stack() |
Modifier and Type | Method and Description |
---|---|
boolean |
isEmpty()
Returns true iff if this Stack is empty
|
T |
peek()
Returns the element from the top of Stack,
without removing it from the stack.
|
T |
pop()
Returns and removes the element from the top of Stack,
If the stack is empty, throws java.util.EmptyStackException
|
void |
push(T data)
Add the data item to top of the Stack.
|
StackADT<T> |
reverse()
Creates a new Stack with the items of this stack
in the reverse order.
|
public boolean isEmpty()
StackADT
public void push(T data) throws java.util.EmptyStackException
StackADT
public T pop() throws java.util.EmptyStackException
StackADT
public StackADT<T> reverse()
StackADT