Question d’entretien chez APT Research

Implement queue with stacks in O(1) push/pop complexity.

Réponse à la question d'entretien

Utilisateur anonyme

12 août 2025

Amortized complexity of O(1) possible; designated push and pop stacks. Reverse (empty) push stack into the pop stack only when a pop operation is called and the pop stack is empty.