Computer Science EngineeringHard

The textbook minimum number of stacks needed to implement a queue is

  1. A. 1
  2. B. 3
  3. C. 2
  4. D. 4

Correct answer: C. 2

One stack receives enqueued items and the other reverses them for dequeue operations.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic