I have a set of 2D points and need to find the fastest way to figure out which pair of points has the shortest distance in the set.
What is the optimal way to do this? My approach is to sort them with quicksort and then calculate the distances. This would be O(nlogn + n) = O(nlogn).
Is it possible to do it in linear time?
Thanks.