Question: 2. (8 pts) (a) Build a Max-Heap by adding the following values, in the order shown, to an empty Max-Heap (don't just draw a Max-Heap

 2. (8 pts) (a) Build a Max-Heap by adding the following

2. (8 pts) (a) Build a Max-Heap by adding the following values, in the order shown, to an empty Max-Heap (don't just draw a Max-Heap storing these values). Insert, 42, then 26, 13, 50, 30, 20, 42 (again), 19, 24, 35, 60 and insert 48 last. Show it (as a tree) below. Do the work elsewhere and transcribe your final answer here, when you are finished. Don't show intermediate work, just the final heap. Important: Problem specifies a Max-Heap, not a Min-Heap! (b) Fill in the values for the array representation of this final Max-Heap (using the standard mapping). 0 123456789 10111213 14 15 16 171819 (c) Remove the maximum value twice, just in the tree you drew above (not the array): draw a box around node(s) that are removed; cross out/rewrite changed values inside node(s) as was done in the reading and class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!