4.3

Hash Tables

Explore how hash tables store and retrieve data using hash functions, and how different collision resolution strategies handle conflicts. Watch insertions, searches, and deletions step by step.

Prerequisite: Arrays, Modular Arithmetic
Key:
Buckets8
Load Factor:0.00
Separate Chainingh(k) = k mod m
[0]
[1]
[2]
[3]
[4]
[5]
[6]
[7]
Empty
Occupied
Collision
Probing
Found/Inserted
Deleted
1.0x
Metrics
Entries0
Load Factor0.00
Collisions0
Avg Probes0.00
Max Chain0
Operation Log
Insert, search, or delete a key to see operations...
How It Works
Separate Chaining

Each bucket stores a linked list of entries that hash to the same index.

Time Complexity
Insert (avg)O(1)
Search (avg)O(1+α)
Delete (avg)O(1+α)
Worst caseO(n)
Key Insight

Hash tables provide O(1) average-case operations by using a hash function to map keys directly to array positions. The load factor (\u03B1 = n/m) determines how full the table is and directly impacts performance.