Stacks (Feb 8)
Warmup Exercises
Takes 10 minutes, take out a sheet of paper and do them. A stack is one of the easier ADTs to implement, so you should definitely be familiar with the basic operations (eg. push, pop, peek, isEmpty).
Read through the parenthesis matching problem in the slides. It's a common example for using stacks, and is sometimes used in coding competitions.
Tutorial Exercise
We will create a MyStack.java class which implements the cpsc331Stack interface.
[cpsc331Stack.java][1KB]