title: HeapSort - Sorted before swapping
body: <p>I was working with algorithms and specifically heapsort. From my understanding the heapsort algorithm involves preparing the list by first turning it into a max heap.</p>
  
  <p>Turning my </p>
  
  <p>[2, 8, 5, 3, 9, 1]</p>
  
  <p>Into<br>
  [9, 8, 5, 3, 2, 1]</p>
  
  <p>With heapsort I am supposed to swap 9 with 1. But by looking at the array straight after max heaping, i see a sorted list in decreasing order. Why is swapping required when the list is already sorted in decreasing order?</p>
  
  <p>This was just thoughts I had after watching: 
  <a href="https://www.youtube.com/watch?v=2DmK_H7IdTo" rel="nofollow noreferrer">https://www.youtube.com/watch?v=2DmK_H7IdTo</a></p>