How many stacks are needed to implement a queue. Consider the sit

How many stacks are needed to implement a queue. Consider the sit
|

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.

A. <p>1</p>

B. <p>2</p>

C. <p>3</p>

D. <p>4</p>

Please scroll down to see the correct answer and solution guide.

Right Answer is: B

SOLUTION

A queue can be implemented using two stacks