🔗 Hash Table — Collision & Chaining
USACO C++ Book · Interactive Visualizer
🔗 Hash Table Insert — Chaining for Collision
Hash Table
O(1) avg
Step 0/8
📊 Hash Table (M=7 buckets, hash(x) = x % 7)
🗂 Statistics
Current Key
—
Hash Result
—
Collision?
—
Load Factor
0/7 = 0.00
Insert:
O(1)
avg
Lookup:
O(1)
avg
Worst:
O(N)
(all collide)
Load factor:
n/M
💻 Code
Hint
Click
Next Step ▶
to start and observe how each key is hashed to its bucket and how collisions are chained.
◀ Prev
Next Step ▶
↺ Reset
0/8
Keyboard:
→
Next
←
Prev
R
Reset