How many stacks are needed to implement a queue. Consider the situation where…

2025

How many stacks are needed to implement a queue. Consider the situation where no other data structure like arrays, linked list is available to you.

  1. A.

    1

  2. B.

    2

  3. C.

    3

  4. D.

    4

Attempted by 483 students.

Show answer & explanation

Correct answer: B

Explanation:

A queue can be implemented using two stacks.

Explore the full course: Coding For Placement