DSA · Reimagined
Hashing medium time O(1) average space O(m)

Hash Table — Linear Probing

A hash function turns a key into a slot index. When two keys want the same slot (a collision), open addressing simply probes forward to the next free slot. Lookups repeat the same walk.

keys to insert
15
0
11
1
27
2
8
3
12
4
table (m = 7, index = slot)
0
1
2
3
4
5
6

Insert each key into 7 slots using h(k) = k mod 7, probing forward on collision.

1 / 13

Practice

Machine twin: /dsa-viz-v2/hash-linear-probing.json — the full deterministic run as structured data.