Standard Stack Operations
- boolean empty()
- void makeEmpty()
- void push (Object item)
- Object pop()
- Object peek()
java.util.Stack
Examples
- Cafeteria trays
- PEZ dispenser
- Palindrome detection
- Balanced parentheses checker
- Reverse Polish Notation (RPN) calculator
- Basis for recursion
Class Code
- Driver.java
- We also extended the java.util.Stack class
and inspected the resulting data structure using the BlueJ
workbench.