Add tree visualiztion to animated operations on the Heap in addition to
the array visualization
Implement the tree part of the visualization of the methods for:
New Heap (empty but with 2 array cells)
Insert
Peek
Remove Max
Random Fill
Heapify
The tree should be drawn for the nItems currently in the heap.
Animate the sift up and sift down operations performed by Insert and
Remove Max. When Random fill creates an array filled with unsorted
values, the tree will just show the first item at its root, a 1-item
heap. During the animation of Heapify, the heapLo variable starts
at the middle of the array and works toward the root. During that
process the bottom nodes of the tree (top nodes of the heap) should be
shown with empty frames for the nodes between the root and heapLo.
Add tree visualiztion to animated operations on the Heap in addition to the array visualization
Implement the tree part of the visualization of the methods for:
The tree should be drawn for the
nItems
currently in the heap. Animate the sift up and sift down operations performed by Insert and Remove Max. When Random fill creates an array filled with unsorted values, the tree will just show the first item at its root, a 1-item heap. During the animation of Heapify, theheapLo
variable starts at the middle of the array and works toward the root. During that process the bottom nodes of the tree (top nodes of the heap) should be shown with empty frames for the nodes between the root andheapLo
.