title: Why do we step by "n + n" in a bottom-up Merge sort?
body: <p>In a bottom-up merge sort for the inner loop, why is there a need for:   i+= n + n?   Won't i += n work just fine? </p>
  
  <p><a href="http://algs4.cs.princeton.edu/22mergesort/MergeBU.java.html" rel="nofollow">http://algs4.cs.princeton.edu/22mergesort/MergeBU.java.html</a></p>
  
  <pre><code> public static void sort(Comparable[] a) {
          int N = a.length;
          Comparable[] aux = new Comparable[N];
          for (int n = 1; n &lt; N; n = n+n) {
              for (int i = 0; i &lt; N-n; i += n+n) {
                  int lo = i;
                  int m  = i+n-1;
                  int hi = Math.min(i+n+n-1, N-1);
                  merge(a, aux, lo, m, hi);
              }
          }
          assert isSorted(a);
      }
  </code></pre>