The Gateway to Computer Science Excellence
0 votes
9 views
MAX-HEAPIFY(A,i)

1   l=Left(i)
2   r=Right(i)
3   if l <= A.heapsize and A[l] > A[i]
4   largest=l
5   else largest = i
6   if r <= A.heapsize and A[r] > A[largest]
7   largest=r
8   if largest!=i
9   exchange A[i] with A[largest]
10  MAX-HEAPIFY(A,largest)

 

Using Figure 6.2 as a model, illustrate the operation of MAX-HEAPIFY(A,3) on the array $A=\langle 27,17,3,16,13,10, 1,5,7,12,4,8,9,0 \rangle$

 

in Algorithms by Boss (41.9k points) | 9 views

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,647 questions
56,459 answers
195,378 comments
100,274 users