Min heap is a complete binary tree.

Category: QuestionsMin heap is a complete binary tree.
Editor">Editor Staff asked 1 month ago

Min heap is a complete binary tree.
 
(a) True
 
(b) False
 
My question comes from Heap topic in portion Heap of Data Structures & Algorithms I
 
This question was addressed to me by my school teacher while I was bunking the class.

1 Answers
Editor">Editor Staff answered 1 month ago

Right option is (a) True
 
The best explanation: A tree, in which all levels are fully filled, except possibly the last level, is called as the complete binary tree. And min heap maintains shape property, so it is a complete binary tree. The shape property ensures that all levels in the min heap are fully filled, except the last one, and, if the last level is not filled completely, then fill the elements from left to right.