Skip to content

Conversation

@dbkuppagiri
Copy link

No description provided.

@super30admin
Copy link
Owner

Strengths:

  • Good use of two stacks to implement the queue functionality.
  • Clear and readable code with appropriate comments.
  • Correct implementation of the push and empty methods.

Areas for Improvement:

  • The peek method should handle the case when both stacks are empty (e.g., return -1 or throw an error).
  • The pop method should check if the queue is empty before attempting to pop (similar to the reference solution).
  • Consider adding more detailed comments about the time complexity of each method.

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.

3 participants