Finding the minimum in an unsorted array in logarithmic time

Michael Eilers Smith picture Michael Eilers Smith · Mar 24, 2011 · Viewed 15k times · Source

Is there an algorithmic approach to find the minimum of an unsorted array in logarithmic time ( O(logn) )? Or is it only possible in linear time? I don't want to go parallel.

Thanks

Michael

Answer

Collin picture Collin · Mar 24, 2011

If the list is unsorted, your search has to be at least linear. You must look at each item at least once, because anything you haven't looked at might be less than what you've already seen.