Monday, December 7, 2020

Hashing function

1:1 if input range is small.

many:1 for large input range.

i%(size of hash table) for example.

Collisions:

Open hashing:

Chaining: Store as a linked list at the location for O(n) lookups.

Store as B-Tree for O(log(n)) lookups.


Closed hashing (within space allocated):

Linear: Keep increasing index until you find an empty spot. Can cause crowding.

Quadratic: Keep exponentially increasing index until you find an empty spot.

No comments:

Post a Comment

Free AI Chat tools

https://grok.com https://x.com/i/grok https://chatgpt.com https://copilot.microsoft.com https://chat.deepseek.com https://www.meta.ai https:...