Is it possible to find two numbers whose difference is minimum in O(n) time

Viewed 11961

Given an unsorted integer array, and without making any assumptions on the numbers in the array:
Is it possible to find two numbers whose difference is minimum in O(n) time?

Edit: Difference between two numbers a, b is defined as abs(a-b)

8 Answers
Related