Do a binary width search to reduce the range, with a singleton overlap in binary partitions. In other words, if you had, say, 17 elements, compare the elements
0,8
8,16
0,4
4,8
8,12
12,16
0,2
2,4
etc., looking for a case where the left element is larger than the right.
Once you find such a range, repeat the procedure by doing the same binary search in that range. Repeat until you find a diminishing adjacent pair.
O (log n), O (n). - ? " " O (log n) O (n), , . .
1, O (log n).