PRACTICE / UNDERSTAND / REPEAT

Data Structures & Algorithms: Stacks & queues

Practice stacks & queues with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

20 questionsAnswers explainedFree · no login
Question 1 of 20
Stacks & queues · MCQQuestion link ↗

A stack receives push(1), push(2), then pop(). What value is removed?

Choose one answer
Answer & explanation

Answer: 2

A stack is last-in, first-out.