Find a local minimum or peak with binary search
Find any local minimum of an array, an element no larger than its neighbours (treat positions outside the array as infinitely large), in O(log n) time. The same idea finds a peak element. Write it iteratively and explain why the half you discard is safe.
No answer yet. Write the first one; the best answer gets endorsed.
