Hey Sloth Nice article. A small correction.
We can insert into the max heap if the top element (i.e. the greatest element) is smaller than the element we're inserting
I think this is incorrect. We should insert into max heap if the inserting element is smaller than the top element of heap and not the other way round.
Manish askani
Hey Sloth Nice article. A small correction.
We can insert into the max heap if the top element (i.e. the greatest element) is smaller than the element we're insertingI think this is incorrect. We should insert into max heap if the inserting element is smaller than the top element of heap and not the other way round.