AlgoScope

Separate Chaining

Data structureintermediateHash Tables and Collision Handling

Each bucket holds a chain of colliding entries; a lookup hashes once and compares keys along that chain.

Decision · step 2 of 12Hash Map: Filling buckets, with collisions
01234

put 12 5: hash the key. 12 mod 5 = 2, so bucket 2 is the only place this key can be. It is empty.

Open in the player →or start at step 2

What you will see

A collision appends a node to the bucket's chain.

How hash map works →

Cost

insertO(1)
searchO(1 + load factor) expected
SpaceO(n + buckets)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.

Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.

Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.

Taught by the same lesson

Hash Map covers these too, in the same run.