Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Im trying to use heapify to fix the problem in the binary heap caused by decreasing a key, but there seems to be a problem?

0
Posted

Im trying to use heapify to fix the problem in the binary heap caused by decreasing a key, but there seems to be a problem?

0

Remember that Heapfiy is not a magic “fix-all” method for the binary heap. If you call heapify(i), this fixes the binary heap if the only violation for the binary heap property is that A[i] might be in violation (e.g. bigger when the min is in A[0]) with one of its children. Heapify does not resolve any other problems.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.