![]() |
AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
|
Implementation of a stack based on aud.Vector
.
More...
Public Member Functions | |
Stack () | |
boolean | is_empty () |
Is stack empty? More... | |
T | top () throws NoSuchElementException |
Get stack top. More... | |
T | pop () throws NoSuchElementException |
Pop element from stack. More... | |
void | push (T x) |
Push x onto stack. More... | |
![]() | |
abstract boolean | is_empty () |
Is stack empty? More... | |
abstract T | top () |
Get stack top. More... | |
abstract T | pop () |
Pop element from stack. More... | |
abstract void | push (T x) |
Push x onto stack. More... | |
String | toString () |
Get string representation "|a|b|c" . More... | |
Additional Inherited Members | |
![]() | |
AbstractStack () | |
create empty stack More... | |
Implementation of a stack based on aud.Vector
.
Definition at line 8 of file Stack.java.
Definition at line 11 of file Stack.java.
boolean aud.Stack< T >.is_empty | ( | ) |
Is stack empty?
Reimplemented from aud.adt.AbstractStack< T >.
Definition at line 14 of file Stack.java.
Referenced by aud.example.IterativePreorderTraversal.iterative_traversal(), aud.example.graph.IterativeDFS1.start(), aud.example.graph.IterativeDFS2.start(), aud.test.StackTest.testStack(), and aud.example.VerboseStack< T >.toString().
T aud.Stack< T >.pop | ( | ) | throws NoSuchElementException |
Pop element from stack.
Requires !is_empty()
.
NoSuchElementException |
Reimplemented from aud.adt.AbstractStack< T >.
Reimplemented in aud.example.VerboseStack< T >.
Definition at line 23 of file Stack.java.
Referenced by aud.example.graph.IterativeDFS1.start(), aud.example.graph.IterativeDFS2.start(), aud.test.StackTest.testInvalid_pop(), and aud.test.StackTest.testStack().
void aud.Stack< T >.push | ( | T | x | ) |
Push x onto stack.
x | new element |
Reimplemented from aud.adt.AbstractStack< T >.
Reimplemented in aud.example.VerboseStack< T >.
Definition at line 31 of file Stack.java.
Referenced by aud.example.grid.Grid.dfs_iterative(), aud.example.graph.IterativeDFS1.start(), aud.example.graph.IterativeDFS2.start(), and aud.test.StackTest.testStack().
T aud.Stack< T >.top | ( | ) | throws NoSuchElementException |
Get stack top.
Requires !is_empty()
.
NoSuchElementException |
Reimplemented from aud.adt.AbstractStack< T >.
Definition at line 17 of file Stack.java.
Referenced by aud.test.StackTest.testInvalid_top(), and aud.test.StackTest.testStack().