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

Hash Table — Chaining

Instead of probing, each bucket holds a linked list. Colliding keys are appended to that bucket’s chain. Lookups hash to a bucket, then walk its short chain.

bucket 0
bucket 1
bucket 2
bucket 3
bucket 4

Insert keys into 5 buckets with h(k) = k mod 5. Collisions extend a chain.

1 / 9

Practice

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