ChoralSoft Learn
How a hash table handles collisions
Why lookups are fast, and what happens when two keys collide.
Drop words into 7 buckets
A hash function turns a word into a bucket number, so lookups jump straight to the right place. When two words land in the same bucket, that is a collision; here they simply chain together.
0
1
2
3
4
5
6
Type a word and press Add.
With few buckets and many words, chains grow and lookups slow toward O(n). Real tables resize to stay near O(1). Compare growth rates.
