In the max heap Increase key procedure
IncreaseKey(int pos, int newValue)
{
heap[pos] = newValue;
while(left(pos) < heap.Length)
{
int smallest = left(pos);
if(heap[right(pos)] < heap[left(pos)])
smallest = right(pos);
if(heap[pos] < heap[smallest])
{
swap(smallest, pos);
pos= smallest;
}
else return;
}
}
When the Max heap property is violated at a node x, we dont call MAX-HEAPIFY procedure to mend the Max-heap property, What is the reason behind it?