In a min heap, how do you ensure that the structure remains valid after inserting a new element? - Study24x7
Social learning Network
2 followers study24x7 02 Sep 2024 11:42 AM study24x7 study24x7

In a min heap, how do you ensure that the structure remains valid after inserting a new element?

A

By swapping the new element with the root if it's smaller

B

By placing the new element in the leftmost available position and then "heapifying" up

C

By sorting the entire heap after each insertion

D

By replacing the largest element if the new element is smaller

study24x7
Write a comment
Most Related Articles