Question d’entretien chez acadnion

how to implement a queue given two stacks

Réponse à la question d'entretien

Utilisateur anonyme

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