An Array-Based Stack (contd.) • Pseudo-Code (contd.) Algorithm push(o): if size() = N then throw a StackFullException t ← t + 1 S[t] ← o Algorithm pop(): if isEmpty() then throw a StackEmptyException e←S[t] S[t]←null t←t-1 return e
Download the Study24x7 App, so you can connect and collaborate.