Open Addressing / Linear Probing (Module 7) Flashcards
Which collision resolution technique finds another open slot in the hash table to store the key when collision occurs?
open addressing
What are the 3 ways to find an avaliable slot through probing?
1) linear probing
2) quadratic probing
3) double hashing
Which type of probing sequentially searches the table from the index of the collision until an open slot is found?
linear probing
What is linear probing’s primary hash function?
hash(k)
What is the linear probing formula?
(hash(k) + i) mod m
What happens when multiple keys are hashed to the same buckets leading to a group of occupied buckets growing with each collision?
clustering
Why is clustering problematic?
collisions lead to longer probe sequences and access times (degraded performance)
Resizing and rehashing is ___________!
expensive
What is the advantage of linear probing?
simple implementation
What is the disadvantage of linear probing?
creates clusters that slow down insertion/search operations