Tag: queue

54 votes
21 answers
2.7K views
How to implement a queue using two stacks?

Suppose we have two stacks and no other temporary variable. Is to possible to "construct" a queue data struct

avatar
Yolando
0 1 0 9
asked 07 September, 2021
53 votes
27 answers
1.2K views
How do you implement a Stack and a Queue in JavaScript?

What is the best way to implement a Stack and a Queue in JavaScript? I'm looking to do the shunting-yard

avatar
Tuan
0 1 0 9
asked 07 September, 2021