Skip to content

Conversation

@pratul2789
Copy link

No description provided.

@super30admin
Copy link
Owner

Your solution is excellent. You have correctly implemented the double hashing technique for the hash set. The code is clean and efficient. Here are a few minor suggestions:

  1. Consider adding comments to explain why you chose 1000 and 1001 for the bucket sizes. This can help others understand that 1001 is chosen to handle the maximum key value (10^6) without index issues.

  2. The return statements at the end of add and remove are unnecessary since the functions are void. You can remove them for brevity.

  3. Although not necessary, you might want to consider using a more descriptive name for the inner bucket constant, such as innerBucketsSize or similar, to make it clear that it represents the size.

Overall, great job! Your solution is correct and efficient.

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