Exam-style question
Try this first
What does the pop operation do to a stack?.
- A.Adds a value to the bottom without changing the top
- B.Removes and returns the top value
- C.Returns the top value but leaves it in place
- D.Checks whether the stack has reached maximum size
Model answer
What a good answer should say
- Removes and returns the top value
Explanation
Why this works
Pop removes the top element from the stack and returns its value.
Common mistake
No common mistake is linked to this question yet.
