Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

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 complexity

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

List the characteristics of a good listener.

Answered: 1 week ago

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago