1.

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

Answer»

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.



Discussion

No Comment Found

Related InterviewSolutions