title: How many comparisons does 8 element Binary Heap need?
body: <p>This is a homework question, and I'm asked to show that 8 element Binary Heap needs 8 comparisons.</p>
  
  <p>but when I use an example such: 1 2 3 4 5 6 7 8 
  I'm not sure if I should go bottom up or top down.
  but anyways, I've tried them both.</p>
  
  <p>In top down:
  I've done it in 8 steps but when I count the number of comparisons I get 13 :S</p>
  
  <p>In bottum up:
  I've done it in 7 steps but when I count the number of comparisons I get 10 :S</p>
  
  <p>After Trying the algorithm here is the comparisons I got:</p>
  
  <ol>
  <li>H[L]=8 > H[i]=4 </li>
  <li>H[L]=8 > H[i]=2, H[r]=5 > H[Largest]=8</li>
  <li>H[L]=4 > H[i]=2</li>
  <li>H[L]=6 > H[i]=3, H[r]=7 > H[Largest]=6</li>
  <li>H[L]=8 > H[i]=1, H[r]=7 &lt; H[Largest]=8</li>
  <li>H[L]=4 > H[i]=1, H[r]=5 > H[Largest]=4 </li>
  </ol>
  
  <p>hmmm, any help on how should I count the number of comparisons so I can show them 8?
  and what method shall I use(bottom up or top down)?</p>