Given a heap of n nodes.The maximum number of tree for building the heap is.

Category: QuestionsGiven a heap of n nodes.The maximum number of tree for building the heap is.
Editor">Editor Staff asked 4 weeks ago

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) logn
 
My question is based upon Binomial and Fibonacci Heap topic in chapter Heap of Data Structures & Algorithms I
 
I had been asked this question by my school principal while I was bunking the class.

1 Answers
Editor">Editor Staff answered 4 weeks ago

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.