Skip to content

Conversation

@Dheepthi-Reddy
Copy link

  • solved Disgn Hashmap
  • solved Implement Queue using stacks

@super30admin
Copy link
Owner

Strengths:

  • The student has a good understanding of the data structures and their implementations.
  • The code is well-commented and easy to follow.
  • The use of helper methods (hashFunc, find) in the HashMap implementation shows good modular design.

Areas for Improvement:

  • In the Queue implementation, the pop method could call peek to avoid duplicating the logic for transferring elements from inStack to outStack. This would make the code more maintainable.
  • The comments in the Queue implementation could be more detailed, especially explaining why the two-stack approach works for queue operations.
  • The time complexity analysis for the Queue could mention the amortized nature of the operations, as the worst-case time complexity for pop and peek is O(n) when outStack is empty.

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