title: To Find the minimum element in an array which is sorted and Rotated
body: <p>I recently faced a programming problem which is as follows:</p>
  
  <p>A sorted array is given and the array is rotated at some unknown point, I have to find the minimum element in it. The Array can contain duplicates too.</p>
  
  <p>For eg:</p>
  
  <pre><code> Input: {5, 6, 1, 2, 3, 4}
  
   Output: 1  
  
   Input: {2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2}   
  
   Output: 0
  </code></pre>
  
  <p>I followed simple solution is to traverse trough the complete array and find minimum. This solution requires  time O(n).I understand the fact that the minimum element is the one whose previous element is greater than it. If there is no such element present, then there is no rotation and first element would be the minimum.</p>
  
  <p>But i was asked for a  O(Logn) solution. Is there a way to solve it in in O(Logn) time?</p>