Skip to content

Conversation

@anushrihub
Copy link

No description provided.

@super30admin
Copy link
Owner

Strengths:

  • The implementation correctly uses two stacks to achieve FIFO behavior.
  • The code is well-commented and easy to understand.
  • The logic for transferring elements between stacks during pop and peek operations is correctly implemented.

Areas for Improvement:

  • The peek method should return -1 (or raise an exception) when the queue is empty, rather than None, to maintain consistency with the pop method and typical queue behavior.
  • The empty method could be used more consistently in the peek method to check for an empty queue before proceeding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants