Argue the correctness of HEAP-INCREASE-KEY using the following loop invariant: At the start of each iteration of
Question:
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.heap-size] 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[1 . .A. heap-size] satisfies the max-heap property at the time HEAP-INCREASE-KEY is called.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Question Posted: