Examveda

How can you efficiently implement a queue using two stacks?

A. By using one stack for enqueue and the other for dequeue

B. By using one stack to store elements and the other to reverse them

C. By alternating between two stacks

D. By using two stacks for different operations

Answer: Option A


This Question Belongs to Data Structure >> Queues In Data Structures

Join The Discussion

Related Questions on Queues in Data Structures