I there an O(n) algorithm for finding minimal distance between numbers in an one dimensional array? Does it matter if all the numbers are positive or negative? The array is not sorted