Skip to content

Add HashMap solution#2478

Open
ADITYABHURAN wants to merge 1 commit into
super30admin:masterfrom
ADITYABHURAN:aditya-solution
Open

Add HashMap solution#2478
ADITYABHURAN wants to merge 1 commit into
super30admin:masterfrom
ADITYABHURAN:aditya-solution

Conversation

@ADITYABHURAN
Copy link
Copy Markdown

No description provided.

@super30admin
Copy link
Copy Markdown
Owner

Create Queue using Stacks (hashmap.py)

The student appears to have submitted code for the wrong problem. The submitted HashMap solution:

  • Correctly implements a hash map with separate chaining for collision resolution
  • Uses appropriate hash function and find helper method
  • Handles put, get, and remove operations properly

However, this solution does not solve the "Create Queue using Stacks" problem at all. The student should:

  1. Ensure they are submitting code for the correct problem
  2. Implement a queue using two stacks approach (push to one stack, transfer and pop from another when needed)
  3. Pay attention to the specific problem requirements

VERDICT: NEEDS_IMPROVEMENT


Implement Hash Map

Strengths:

  • Clean, well-documented code with clear comments
  • Correct implementation of the separate chaining approach
  • Proper handling of edge cases (key not found, updating existing values)
  • Good variable naming conventions

Areas for Improvement:

  • The solution is functionally equivalent to the reference and doesn't require significant changes
  • Minor: Could consider using a dummy head node like the reference solution for slightly cleaner logic in edge cases
  • The find method could be slightly more robust by checking for None before accessing .key

The solution demonstrates a solid understanding of hash map implementation and correctly solves the problem.

VERDICT: PASS

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