1.

How many nodes does a leftist tree with r nodes must have?(a) 2^r(b) 2^r-1(c) 2r(d) 2r-1My doubt is from Heap in section Heap of Data Structures & Algorithms II got this question in an interview.

Answer»

Correct answer is (B) 2^r-1

The best explanation: A leftist tree with r NODES on the RIGHT path is proved to have at least 2^r-1 nodes. This theorem is proved by induction.



Discussion

No Comment Found

Related InterviewSolutions