If every item of the list maps to a unique index in the hash table, the hash function is called ________.
If every item of the list maps to a unique index in the hash table, the hash function is called ________.
Solution
A perfect hash function maps every item in the set to a unique index in the hash table, so no two items collide and every lookup takes constant time.
Option 2: a universal hash function is a randomly chosen function from a family, designed so that the expected number of collisions is low. It does not guarantee zero collisions.
Option 3: a collision is the event where two keys map to the same index. It is not a type of hash function.
A minimal perfect hash function goes one step further. It maps items to exactly slots with no empty slots.
Related questions:
2025: 21 May Shift 1
2026: 31 May Shift 1