Implement Queue based on a stack
Utilisateur anonyme
Do insertions need to be the same running time? Off the top of my head, I would say once insertions to the queue are finished, pop everything off of stack A and push onto stack B. To remove from the queue, pop from stack B. To insert to the queue, pop everything off of stack B, push onto A, push the new insertion onto A, then move everything back to B.