Min heap is a complete binary tree.

Category: QuestionsMin heap is a complete binary tree.
Editor">Editor Staff asked 5 months 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 5 months 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.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40702