Implement Queue Using Stacks
Try to solve the Implement Queue Using Stacks problem.
We'll cover the following...
Statement
Design a custom queue, MyQueue, using only two stacks. Implement the Push(), Pop(), Peek(), and Empty() methods:
- Void Push(int x):
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy