Everforth CyberCoders Interview Question

Explain how to add a node on Heap tree.

Interview Answer

Anonymous

Jul 12, 2014

Add the new node to the bottom of the heap tree. If the value is not greater than its parent, you are done. If it is greater, swap the position of the node and its parent. Repeat the process until the node value is no longer greater than its parent's value.

6