title: Selection of middle element in merge sort
body: <p>For a given merge sort code below:</p>
  
  <pre><code>void merge(int a[], int bottom, int top, int mid){
      int i = bottom;
      int j = mid+1;
      int k = bottom;
      int c[50];
  
      while (i &lt;= mid&amp;&amp;j &lt;= top){
           if(a[i]&lt;=a[j]){
           c[k] = a[i];
           i++;
           k++;
           }
       else{
           c[k] = a[j];
           j++;
           k++;
           }
      }
  
      while (i &lt;= mid){
       c[k] = a[i];
       k++;
       i++;
      }
  
      while (j &lt;= top){
       c[k] = a[j];
       k++;
       j++;
      }
  
      for (int i = bottom; i &lt; k; i++){
       a[i] = c[i];   
      }
  }
  
  void mergesort(int a[], int bottom, int top){
      if(bottom &lt; top){
       int mid = (bottom+top)/2;
       mergesort(a, bottom, mid);
       mergesort(a, mid+1, top);
       merge(a, bottom, top, mid);
      }
  }
  </code></pre>
  
  <p>If change the mergesort calling to </p>
  
  <pre><code>mergesort(a, bottom, mid-1);
  mergesort(a, mid, top);
  </code></pre>
  
  <p>It will cause run time error. </p>
  
  <p>From the aspect of algorithm, I didn't see any difference. Could some one point out what's wrong with the change?</p>