What is the minimum number of queues needed to implement a stack ?

2026

What is the minimum number of queues needed to implement a stack ?

  1. A.

    1

  2. B.

    2

  3. C.

    3

  4. D.

    Cannot be implemented

Attempted by 276 students.

Show answer & explanation

Correct answer: B

A stack can be implemented using two queues. One queue is used for push operations, and the other helps in maintaining stack order during pop.

Explore the full course: Niacl Ao It Specialist