Question: Problem 1 Incrementally buildthe binary min-heap for the numbers: 6, 3, 8, 5, 2, 10, 4. Show how the addition of each number changes the
Problem 1
Incrementally buildthe binary min-heap for the numbers: 6, 3, 8, 5, 2, 10, 4. Show how the addition of each number changes the tree. Use arrows to indicate how the numbers percolate up from their initial starting point to their final location if they move at all once inserted.
Problem 2
Delete3numbers from the min-heap created in Problem 1. Show how each deletion changes the tree. Use arrows to indicate how numbers that get moved to the root percolate down to their final location.
Problem 3
Apply the heapify algorithm to the turn an array holding the numbers 6, 3, 8, 5, 2, 10, 4 into a binary min-heap. First sketch the implied binary tree for the array data. Then sketch how this binary tree gets heapified thru processing of the internal nodes. Use arrows to indicate how numbers percolate during the process.Label each update of the binary heap by the index of the internal node considered.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
