A stack receives push(1), push(2), then pop(). What value is removed?
Answer & explanation
Answer: 2
A stack is last-in, first-out.
Practice stacks & queues with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
Answer: 2
A stack is last-in, first-out.