Question: MaX - Heap - Extract - Max ( A ) , Max - Heap - Increase - Key ( A , i , k )
MaXHeapExtractMax MaxHeapIncreaseKey and MaXHeapInsert Con
sider the following operation MAxHEAPDelete which will remove the element at index i from a
max heap.
MAXHEAPDelete
if Aheapsize
error "index out of range"
MAXHEAPINCREASEKEY
MAXHEAPEXTRACTMAX
Q a
Given a maxheap represented by array :: perform MAXHEAP
Delete to remove the element from the heap. Show the updated array after each step a swap
or a key value change For each step, draw the corresponding binary tree representation along with the
updated array.
Q b
Analyze the running time of algorithm MAXHEAPDELETE in terms of heap size If the
bestcase and worstcase running times differ, specify each using notation, and describe the scenarios
that lead to the bestcase and worstcase performance.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
