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.
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.