Frage im Vorstellungsgespräch bei acadnion

how to implement a queue given two stacks

Antwort im Vorstellungsgespräch

Anonym

18. Mai 2017

Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. This method makes sure that newly entered element is always at the top of stack 1, so that deQueue operation just pops from stack1