Without sorting the elements we have around n^2 elements to look from, to
find the smalled element.
But, after sort, we will have only n-1 elements to look from. So, O(nlogn)
is what I see, the best case.
Is there really a O(n) solution, as finding the diff between elements should
be done
A radix sort would provide an O(n) solution for any fixed-size integer
data type.
Dave
On Oct 10, 10:19 am, sravanreddy001 sravanreddy...@gmail.com wrote:
Without sorting the elements we have around n^2 elements to look from, to
find the smalled element.
But, after sort, we will have only