Question: 1. Construct a Binary Heap using the following sequence of numbers as input. It is up to you to decide to construct a Max

 1. Construct a Binary Heap using the following sequence of numbers as input. It is up to you to decide to 

1. Construct a Binary Heap using the following sequence of numbers as input. It is up to you to decide to construct a Max heap or Min heap. 28 12 17 5 7 22 13 12 4 Do all of the following. A subset of your solutions will be graded. 1. Write a Max_heapify or Min_heapify function, depending on your construction decision 2. Write a Build_heap function using the given series of numbers. 3. Write a Delete_root function to delete a root node from the heap. 4. Write a print function to display the heap. (print all nodes which have the same level in one line) Example 2 00 19 16 10 20 13 11 16 The above tree will have the following output: 20 196 15 16 4 12 2 8 10 13 12

Step by Step Solution

3.29 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

include using namespace std To heapify a subtree rooted with node i which is an index in arr N is si... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!