title: Insertion Sort algorithm by using binary search error
body: <p>I run the following code which is Insertion Sort algorithm that use binary search to find the right position of the item being inserted instead of linear search but there are two numbers in the results not sorted correctly!</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void insertion_sort (int a[], int n /* the size of array */)
  {
      int i, temp,j;
      for (i = 1; i &lt; n; i++)
      {
          /* Assume items before a[i] are sorted. */
          /* Pick an number */
          temp = a[i];
  
          /* Do binary search to find out the
             point where b is to be inserted. */
  
          int low = 0, high = i - 1, k;
  
          while (high-low&gt;1)
          {
              int mid = (high + low) / 2;
  
              if (temp &lt;= a[mid]) 
                  high = mid;
              else 
                  low = mid;
          }
  
          /* Shift items between high and i by 1 */
          for (k = i; k &gt; high; k--)
              a[k] = a[k - 1];
  
          a[high] = temp;
      }
  }
  
  
  int main()
  {
      int A[15]={9,5,98,2,5,4,66,12,8,54,0,11,99,55,13};
      insertion_sort(A,15);
      for (int i=0; i&lt;15; i++)
          cout&lt;&lt;A[i]&lt;&lt;endl;
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <p><img src="https://i.stack.imgur.com/eAaB5.png" alt="enter image description here"></p>
  
  <p>Why?</p>