1.

Given a heap of n nodes.The maximum number of tree for building the heap is.(a) n(b) n-1(c) n/2(d) lognMy question is based upon Binomial and Fibonacci Heap topic in chapter Heap of Data Structures & Algorithms II had been asked this question by my school principal while I was bunking the class.

Answer»

The correct option is (a) n

Explanation: Each node could be seen as a TREE with only one node and as a result maximum SUBTREE in the HEAP is EQUAL to number of NODES in the heap.



Discussion

No Comment Found

Related InterviewSolutions