how to implement a queue given two stacks
Utilisateur anonyme
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