Skip to content
StackDecode
Divide & conquerExplained

Closest Pair of Points

Split by x, solve each half, check the strip near the dividing line.

Time

O(n log n)

Extra space

O(n)

Use it for

Computational geometry.

An animated walkthrough for this algorithm isn’t built yet. The summary above explains the idea; see the related animated algorithms below to practise the same technique.