Data Structures, Algorithms, & Applications in C++
Chapter 12, Exercise 27
The initial complete binary tree is:
This tree is already heapified.
The configuration after the max element is removed from the heap is:
The configuration after the next element is removed from the heap is:
The configuration after the next element is removed from the heap is:
The configuration after the next element is removed from the heap is:
The configuration after the next element is removed from the heap is:
The configuration after the next element is removed from the heap is:
The configuration after the next element is removed from the heap is:
The configuration after the next element is removed from the heap is:
The configuration after the next element is removed from the heap is:
The configuration after the next element is removed from the heap is:
This last configuration represents the sorted array.