Hash Table Internals

Two collision resolution strategies: Chaining (linked list per bucket) vs Open Addressing (linear probing). Watch collisions happen and load factor affect performance.

Chaining (M=11 buckets)

Each bucket holds a linked list. Worst case O(n) per op when all keys collide.

Open Addressing / Linear Probe

h(k,i)=(h(k)+i) mod M. Clusters form under high load. Deleted slots marked as tombstones.
Type a key and insert it into both tables simultaneously
Chain load: 0.00 Probe load: 0.00 Chain collisions: 0 Probe probes: 0