AlgoScope

Hash Table Insert

AlgorithmintermediateHash Tables and Collision Handling

Hash the key to a slot, then walk forward past anything already there.

Decision · step 3 of 8Hash Table: Insert that walks past a collision
0121232133445678910probe12 > 45

Slot 1 holds 12, not 45. Walk on to slot 2.

Open in the player →or start at step 3

What you will see

KEY -> HASH -> INDEX; the key travels to its bucket; a collision triggers chaining or probing.

How hash table works →

Cost

BestO(1)
AverageO(1)
WorstO(n)
SpaceO(1)

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: Buckets announce index, occupancy and keys; each step announces the hash value and where the key lands.

Reduced motion: Keys appear in their bucket with a crossfade instead of travelling from the hash label.

Before this

Leads to

Topics that need this one first.