Added Robin Hood Hashing in Hashmap for Optimized Probe Length Management #1542
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title: Add Robin Hood Hashing Algorithm for Optimized Hash Table Collisions
Issue: #1462
Description:
This PR introduces an implementation of the Robin Hood Hashing Algorithm, a variation of open addressing designed to reduce clustering and improve the lookup and insertion efficiency in hash tables. Robin Hood hashing balances load by minimizing the maximum probe distance for each entry, ensuring more efficient performance even at high load factors.
Changes:
robin_hood_hashing.c
implementing the Robin Hood Hashing Algorithm in C.insert
: Inserts key-value pairs with probe distance adjustments.search
: Searches for keys with minimized probe distances.delete
: Marks elements as deleted to preserve probe order.Motivation:
Robin Hood Hashing reduces clustering in hash tables by balancing probe distances, making it useful for handling high load factors efficiently. This feature will help users working with dense datasets and scenarios requiring fast lookups.
How it helps:
Testing:
Additional Notes:
This implementation adds value for users who handle large datasets in hash tables and require optimal collision resolution.