Question: You are given a Heap represented by an array A[1, ..., n]. One of the values in the Heap needs to be changed to a
You are given a Heap represented by an array A[1, ..., n]. One of the values in the Heap needs to be changed to a different value. Say, the kth element, 1 <= k <= n, is to be updated to a new value X. Write pseudocode to perform fixing the Heap when you update this value. Hint: Consider three cases, A[k] == X, A[k] > X, A[k] < X.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
