Closest Pair of Points

Divide & Conquer — median split, the 2δ strip, and the bounded comparisons

Brute force O(n²) Divide & Conquer O(n log n) Sweep line O(n log n) Randomized grid O(n) exp
Slow Fast
Step: 0/0
delta:
Comparisons: 0
Recursion depth: 0
Points: 0
point median line strip (|x−mid|<δ) comparing closest pair active region

What's happening

Press Start to run the divide-and-conquer closest-pair algorithm, or Step to advance one step at a time.

Complexity

ApproachTimeSpace
Brute forceO(n²)O(1)
Divide & conquerO(n log n)O(n)
Sweep lineO(n log n)O(n)
Randomized gridO(n) expO(n)
Strip scan / pointO(1) (≤7)
Lower boundΩ(n log n)

Operation Log