How to implement a queue using two stacks?
Asked 07 September, 2021
Viewed 2.7K times
  • 54
Votes

Suppose we have two stacks and no other temporary variable.

Is to possible to "construct" a queue data structure using only the two stacks?

21 Answer