Suppose you are given an unsorted array containing only non-negative integers. How will you find the absolute minimal difference between any two numbers in the array?
The algorithm to find the minimal absolute difference between two numbers in the array works as follows:
Time complexity = \( O(nlogn) \). The following code snippet (in Java) illustrates the approach. public int absMinDifferenceInAnArray(int[] array){ |