Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(15 points) A max-heap with capacity 20 and size 10 is shown in the following array format. The following three sub-questions all refer to this
(15 points) A max-heap with capacity 20 and size 10 is shown in the following array format. The following three sub-questions all refer to this max-heap (not the heap you obtained after doing some operations). (a) On the answer sheet, show the result after applying heap-extract-max (A) to the maxheap at the start of this question. (b) On the answer sheet, show the result after applying heap-increase-key (A, 10, 49) to the max-heap at the start of this question. (c) On the answer sheet, show the result after applying max-heap-insert (A, 48) to the max-heap at the start of this question. Q1: Read the instructions for question Q1 in the assignment document. For each of the three sub-questions, write your answer to the question in the given space. (a): After the extract-max operation, we have A[1]= A[2]= A[3]= A[5]= A[10]= (b): After the increase-key operation, we have A[1]= A[2]= A.[3]= A[5]= A[10]= After the insertion operation, we have
Step 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