Stacks:Top, IsEmpty, Size
To find out what is at the top of the stack just return the value of head -> x
The stack is empty if head is pointing at NULL
How do I determine the size of the stack?
- Keep a counter which increments when I add and decrements when I delete a node
Don’t forget about Underflow!
Do we need to check for Overflow?