
Closest-Pair(p1, …, pn)
{
If n ≤ 1 return ∞
Compute separation line L such that half thepoints
are on one side and half on the other side
d1 = Closest-Pair(left half)
d2 = Closest-Pair(right half)
d = min(d1,d 2)
Let S be the set of points at distance at most dfrom
separation line L.
Sort S by y-coordinate.
Scan points in y-order and compare distancebetween
each point and next 11 neighbors. If any of these
distances is less than d, update d.
return d
}
2. Modify the
PayPal Gateway not configured
PayPal Gateway not configured