[Verse 1]
Picture scattered points across a plane, coordinates everywhere
Need to find the tightest duo, shortest distance pair
Brute force checks them all, O of n squared complexity
But divide and conquer slices through with logarithmic harmony
[Chorus]
Divide the plane in half, recursive calls cascade
Left side minimum, right side minimum displayed
But watch the middle strip, where secrets often hide
Sort by y-coordinate, scan seven points each side
[Verse 2]
Split along the x-axis, median becomes the wall
Solve each half separately, let recursive magic crawl
Delta holds our current best, the champion distance found
But crossing pairs might steal the crown when boundaries come unwound
[Chorus]
Divide the plane in half, recursive calls cascade
Left side minimum, right side minimum displayed
But watch the middle strip, where secrets often hide
Sort by y-coordinate, scan seven points each side
[Bridge]
Seven is the magic number, mathematical proof declares
No need to check beyond that count when scanning strip-wise pairs
If distance exceeds our delta, break the loop and move ahead
Constant time per point achieved, efficiency widespread
[Verse 3]
Base case triggers when we hit three points or less
Brute force handles tiny sets without computational stress
Merge the answers bubbling up, compare across the seam
Closest pair emerges clean from this recursive scheme
[Chorus]
Divide the plane in half, recursive calls cascade
Left side minimum, right side minimum displayed
But watch the middle strip, where secrets often hide
Sort by y-coordinate, scan seven points each side
[Outro]
O of n log n runtime, geometric algorithms shine
When proximity matters most, this strategy draws the line