AlgoScope

Hash Set

Data structureintermediateHash Tables and Collision Handling

A hash table holding keys only, to answer whether something is present.

Decision · step 3 of 6Hash Table: Find a key behind a collision
01234551662778910probe5 > 27

Slot 5 holds 5, not 27. Walk on to slot 6.

Open in the player →or start at step 3

What you will see

Duplicate insert lands on an existing key and bounces off.

How hash table works →

Cost

addO(1) expected
containsO(1) expected
removeO(1) expected
SpaceO(n)

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.

Before this

Related