Finding the maximum or minimum value in a sequence that increases montonically and then decreases monotonically can be done in O(log n).
However, if i want to check if a number exists in such a sequence, can this also be done in O(log n)?
I do not think that is possible. Consider this example: 1 4 5 6 7 10 8 3 2 0.
In this example, if I need to find whether the sequence contains '2', I do not have any conditions to divide the search space into half of the original search space. In the worst, case it will be O(n), as you need to check for both halves, when we are trying to search for 2.
I would like to know, if this search be done in O(log n) time?