title: Finding an number in montonically increasing and then decreasing sequencecera
body: <p>Finding the maximum or minimum value in a sequence that increases montonically and then decreases monotonically can be done in O(log n).</p>
  
  <p>However, if i want to check if a number exists in such a sequence, can this also be done in O(log n)?</p>
  
  <p>I do not think that is possible.  Consider this example: 1 4 5 6 7 10 8 3 2 0.</p>
  
  <p>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.</p>
  
  <p>I would like to know, if this search be done in O(log n) time?</p>