Now I have a heap or priority queue to maintain the max value of a series of numbers. Usually, if I want to pop the max value, fetching and removing the root number then putting the last number in the root and shifting down to balance; If I want to add a new number, adding the number at the end of the heap then shifting up to balance.
So my question: If I want to pop the max value and immediately add new value, could I just remove the root number and put the new one in the root then shifting down to balance? If it is wrong, why? If it is true, how to prove it?