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
Answer and explanation
Concise answer
Removes and returns the top value
Why this is correct
Pop removes the top element from the stack and returns its value.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
