The Gateway to Computer Science Excellence
0 votes
5 views
HEAP-EXTRACT-MAX(A)

1  if A.heap-size < 1
2  error “heap underflow”
3  max=A[1]
4  A[1]=A[A.heapsize]
5  A.heapsize=A.heapsize-1
6  MAX-HEAPIFY(A,1)
7  return max  

Illustrate the operation of HEAP-EXTRACT-MAX on the heap $A=\langle 15,13,9,5,12,8,7,4,0,6,2,1 \rangle$.

in Algorithms by Boss (41.9k points) | 5 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,645 questions
56,559 answers
195,717 comments
101,599 users