title: Binary search if array contains duplicates
body: <p>Hi,</p>
  
  <p>what is the index of the search key if we search for 24 in the following array using binary search.</p>
  
  <pre><code>array = [10,20,21,24,24,24,24,24,30,40,45]
  </code></pre>
  
  <p><p>I have a doubt regarding binary search that how does it works if a array has duplicate values.Can anybody clarify...</P></p>