title: When building heap, is heap unique?
body: <p>I'm studying heap &amp; heap sorting.<br>
  There is a array : <code>arr[8] = {6,9,3,1,8,7,2,11}</code> <br>
  When I'm trying to build the heap, using code and pencil, I faced two kinds of heap.<br></p>
  
  <p>When using code, 
  MaxHeap : 11 9 7 6 8 3 2 1 </p>
  
  <p>When using insertion theory, MaxHeap : 11 9 7 8 6 3 2 1</p>
  
  <p><br>
  The code that i'm using : <br></p>
  
  <pre><code>int[] DoHeapSort(int[] value) {
      int length = value.length;
  
      for (int i = length / 2; i &gt; 0; i--) {
          maxHeapify(value, i, length);
      }
  
      //print Heap
      for(int i = 0 ; i&lt;value.length; i++)
          System.out.println(value[i]);
  
      return (value);
  }
  
  
  void maxHeapify(int[] array, int index, int heapSize) {
      int left = index * 2;
      int right = left + 1;
      int max = index;
  
      if (left &lt;= heapSize &amp;&amp; array[left - 1] &gt; array[index - 1]) {
          max = left;
      }
  
      if (right &lt;= heapSize &amp;&amp; array[right - 1] &gt; array[max - 1]) {
          max = right;
      }
  
      if (max != index) {
          swap(array, index - 1, max - 1);
          maxHeapify(array, max, heapSize);
      }
  }
  </code></pre>
  
  <p>Theory, in this case, create another array for heap and insert from 6 to 11 in order. (On the other hand, code is in-place heap)</p>
  
  <p>Both maxHeap results satisfied heap definition. Then Heap is not unique ?  Thanks</p>