Collisions
Pigeonhole principle says we can’t avoid all collisions
- try to hash without collision m keys into n slots with m > n
- try to put 6 pigeons into 5 holes
What do we do when two keys hash to the same entry?
- open hashing: put little dictionaries in each entry
-
- closed hashing: pick a next entry to try
shove extra pigeons in one hole!