I have an integer array with some finite number of values. My job is to find the minimum difference between any two elements in the array.
Consider that the array co
This is actually a restatement of the closest-pair
problem in one-dimension
.
https://en.wikipedia.org/wiki/Closest_pair_of_points_problem
http://www.cs.umd.edu/~samir/grant/cp.pdf
As the Wikipedia article cited below points out, the best decision-tree model of this problem also runs in Ω(nlogn)
time.