Domanda di colloquio di Klarna

How can you implement a queue with just a stack?

Risposta di colloquio

Anonimo

6 ott 2015

using two stacks. while Enqueue, push in stack 1, for Dequeuing, pop all from stack 1 , push to stack 2, Finally pop stack 1

2