...

/

Implement Queue Using Stacks

Implement Queue Using Stacks

Try to solve the Implement Queue Using Stacks problem.

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