Closest Pair of Points
Find the two closest points using divide and conquer - O(n log n) complexity
Select Input
Choose a predefined test file or upload your own
Select a test file and click "Run Algorithm" to see the visualization
Algorithm Information
How it works:
- Sort points by x-coordinate
- Divide points into two halves
- Recursively find closest pairs in each half
- Find closest pair across the dividing line
- Return the minimum distance found
Time Complexity:
O(n log n) - much better than brute force O(n²)
Space Complexity:
O(n) - for storing sorted arrays