Question d’entretien chez Klarna

How can you implement a queue with just a stack?

Réponse à la question d'entretien

Utilisateur anonyme

6 oct. 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