Frage im Vorstellungsgespräch bei Klarna

How can you implement a queue with just a stack?

Antwort im Vorstellungsgespräch

Anonym

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