In: Computer Science
Please answer this question with explanation. I will upvote your answer if it is correct and clear. Thank you!
You are given a positive integer n of the form n = 2h − 1, for some integer h ≥ 1. Give an example of an array of length n where the following method of building a heap
step 1. Place the new key at the first free leaf
step 2. The heap-order property might be violated: perform a
bubble-up,
uses Ω(n log(n)) element comparisons. Justify your answer.