Google News
logo
Data Structures Algorithms - Quiz(MCQ)
In binary heap, whenever the root is removed then the rightmost element of last level is replaced by the root. Why?
A)
It is the easiest possible way.
B)
Because left and right subtree might be missing.
C)
To make sure that it is still complete binary tree.
D)
None of the above

Correct Answer : Option (C) :   To make sure that it is still complete binary tree.


Explanation : A binary heap (whether max or min) has to satisfy the property of complete binary tree at all times.

Advertisement