<DS/>DS_VISUALIZER
FoundationsOOPArraysLinked ListStacksQueuesTreesGraphsHashingStrings
exploreExplore
homechevron_rightTopicschevron_rightHashingchevron_rightCollision Resolution
call_merge

HASHING · COLLISION RESOLUTION

Collision Resolution

Two keys, one slot: chain them, or probe the table for another home.

Choose a strategy

linkarrow_outward

Separate Chaining

Each slot owns a linked list; collisions join it.

O(1+α)O(n+m)◍ 0/6
arrow_forwardarrow_outward

Linear Probing

(h+i) mod m — step right until free; clusters grow.

O(1) avgO(m)◍ 0/6
movingarrow_outward

Quadratic Probing

(h+i²) mod m — square jumps leap over clusters.

O(1) avgO(m)◍ 0/6
tagarrow_outward

Double Hashing

(h₁+i·h₂) mod m — a second hash sets the step size.

O(1) avgO(m)◍ 0/6