title: Confuse in Binary Search when to use left < right ; left <= right ; and few more
body: <p>I've difficulty in understanding when to use:</p>
  
  <pre><code>while (left &lt; right ) {
  }
  </code></pre>
  
  <p>vs when to use:    </p>
  
  <pre><code>while (left &lt;= right ) {
  }
  </code></pre>
  
  <p>Also while setting left and right boundaries sometimes we use:</p>
  
  <pre><code>left = mid 
  </code></pre>
  
  <p>and sometime we use</p>
  
  <pre><code>left = mid + 1;
  </code></pre>
  
  <p>similarly</p>
  
  <pre><code>right = mid; vs
  right = mid - 1;
  </code></pre>
  
  <p>Is there any fundamental I am missing in knowledge of Binary search ?</p>