Skip to content

implemented my hashmap#1684

Open
AlexanderShpilka wants to merge 1 commit into
mate-academy:masterfrom
AlexanderShpilka:task/js-hash-map
Open

implemented my hashmap#1684
AlexanderShpilka wants to merge 1 commit into
mate-academy:masterfrom
AlexanderShpilka:task/js-hash-map

Conversation

@AlexanderShpilka

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Excellent work on your MyHashMap implementation! All the core requirements are met, and the code is clean and well-structured. I am approving this solution.

For future reference, it's a good practice to avoid using 'magic numbers'. In your resizeIfNeeded method, the value 2 used for resizing could be defined as a named constant, like private static final int RESIZE_MULTIPLIER = 2;. This makes the code more readable and easier to maintain, which aligns with checklist item #2.

Overall, this is a very strong submission. Well done!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

return;
}
Node<K, V>[] oldTable = table;
table = new Node[oldTable.length * 2];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value 2 used as the resizing multiplier is a magic number. It's better practice to declare it as a named constant (e.g., RESIZE_MULTIPLIER) at the top of the class to improve readability and make it easier to change in the future. This addresses checklist item #2.

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