Question: ****python**** a) Draw the heap structure after inserting the following integer search key values (in the order given) into an empty min-heap: 89, 23, 56,
****python****
a) Draw the heap structure after inserting the following integer search key values (in the order given) into an empty min-heap: 89, 23, 56, 14, 28, 77. Using a tree diagram (not an array), show the structure of the heap after each insertion.
b) Consider the heap structure from part a), what does the heap structure look like after removing the root and restoring the heap order? Show the steps involved. Include a brief explanation of the steps.
c) What does the heap structure look like if we build a heap from a Python list [89, 23, 56, 14, 28, 77] using the perc_down() method? Show the steps involved. Include a brief explanation of the steps.
Thank you!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
