Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer the following questions and justify your answers f) (10 points) The following is the Build-Max-Heap(A) procedure. BUILD-MAX-HEAP (A) 1 A.leq-size= .length 2 fori LA.length/2]

Answer the following questions and justify your answers image text in transcribed
image text in transcribed
f) (10 points) The following is the Build-Max-Heap(A) procedure. BUILD-MAX-HEAP (A) 1 A.leq-size= .length 2 fori LA.length/2] downto 1 3 MAX-HEA PIFY (A,i) Rewrite Build-Max-Heap(A) into Build-Min-Heap(A) to build a min-heap. 8) (5 points) Execute your procedure Build-Min-Heap(A) to the array A . Provide what A becomes after the execution of Build-Min-Heap(A) and draw the resulting heap. You must provide the representation as an array and a heap You may draw by hand the resulting heap, take a picture of your drawing, and insert it in this file. h) (15 points) Analyze the time complexity of your Build-Min-Heap(A) procedure. ) (25 points) Review in the textbook the proof of correctness of Build-Max-Heap to howldemonstrate that your Build-Min-Heap(A) is correct. (Use the same method/framework used by the author of the textbook)

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

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions

Question

=+ How would you advise those problems be resolved?

Answered: 1 week ago