Back to QuestionsPractice with This Question
Implement a Queue using Stacks
26.2K views•Asked at Uber•
Easy
Question Explain
Implement a First-In-First-Out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (`push`, `peek`, `pop`, and `empty`).
Start Trying This Question Simulation
Practice answering orally or with text to get instant AI feedback.