Question: a . Suppose A [ 1 n ] and B [ 1 n ] are heaps storing key values. Does C [ 1 n ]
a Suppose A n and B n are heaps storing key values. Does
C n where Ci Ai Bi for i n represent a heap? Why or why not?
b Again, let A n store the keys of a heap. Write a pseudocode for the
method replaceKeyi k: Replace the key at Ai with k
You must incorporate the pseudocode for BubbleUp and BubbleDown in your algorithm. Briefly explain why your implementaon is correct and why its running time is Olog n
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
