The Gateway to Computer Science Excellence
0 votes
6 views

Argue the correctness of HEAP-INCREASE-KEY using the following loop invariant:

At the start of each iteration of the while loop of lines $4–6$, the subarray $A[1..A.heapsize]$ satisfies the max-heap property, except that there may be one violation$::$ $A[i]$ may be larger than $A[parent(i)]$.

You may assume that the subarray $A[a..heapsize]$ satisfies the max-heap property at the time HEAP-INCREASE-KEY is called.

in Algorithms by Boss (42.4k points)
edited by | 6 views

Please log in or register to answer this question.

Related questions

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,737 questions
57,313 answers
198,349 comments
105,051 users