HeapSort Algorithmic

Objective

The objective of this experiment is to generate a sorted list of numbers in ascending order from a Max Heap.

Experiment Setup

The HeapSort Algorithmic experiment consists of a Max Heap. Click on "Next" button to follow the HeapSort Algorithm. Following three steps are repeated in order untill we have a tree with a single node:

  1. Swap the value of the first and the last node which are highlighted in red color.
  2. Remove the last node from the tree and add it to the front of the generated list.
  3. Heapify the Root node.

If single node remains, remove it and add it to the front of the list.