3import java.util.NoSuchElementException;
21 @Override
public T
pop() throws NoSuchElementException {
28 @Override
public void push(T x) {
34 private void print(String message) {
35 for (
int i=0;i<height_;++i)
36 System.err.print(
" ");
37 System.err.println(message+
" => "+
toString());
46 return (bottom+(bottom.length()>1 ?
"|":
""))+x;
Implementation of a stack based on aud.Vector.
boolean is_empty()
Is stack empty?
A stack that outputs messages on push and pop.
String toString()
Get string representation "|a|b|c".
T pop()
Pop element from stack.
void push(T x)
Push x onto stack.
AuD lecture: Data structures, algorithms, examples.