During the shift up processes, which scenario will cause the maximum number of…
2025
During the shift up processes, which scenario will cause the maximum number of element interchanges for a newly inserted node?
- A.
The node is inserted at the root
- B.
The node is inserted in middle of heap
- C.
The node is the smallest in the heap
- D.
The node is the largest among all inserted so far
Attempted by 82 students.
Show answer & explanation
Correct answer: D
In a heap, shift-up moves nodes toward the root when the heap property is violated. Maximum interchanges occur if the new node travels from a leaf position all the way to the root.