Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help Question 6 (Total 12 marks): Heaps Given the following list of numbers: 30, 44, 97, 36, 61, 38, 86, 74, 51, 35 a)
please help
Question 6 (Total 12 marks): Heaps Given the following list of numbers: 30, 44, 97, 36, 61, 38, 86, 74, 51, 35 a) (2 marks). Draw the heap (as a tree diagram) that would be built if the above numbers were inserted as priorities into a max heap in the order they are listed. (Show your working). b) (2 marks). Convert the heap tree in your answer from part (a) into an array representation of the tree. c) (2 marks). Show what the array form of the heap would look like while inserting the value of 95 into the heap (show each step of the trickle-up process). f) (6 marks). Do you agree with the statement: "A heap tree is the only efficient way to implement a priority queue"? Discuss this with reference to time complexityStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started