I have a set of n points in the form of (X,Y)
and I want to find the closest point to each point in the set and the other point also belong to the same set.
The naive algorithm is simple and O(n^2)
but I want to do something better.
Any help is appreciated.