+1 vote
in Data Structures & Algorithms I by (88.2k points)
How many nodes does a leftist tree with r nodes must have?

(a) 2^r

(b) 2^r-1

(c) 2r

(d) 2r-1

My doubt is from Heap in section Heap of Data Structures & Algorithms I

I got this question in an interview.

1 Answer

+1 vote
by (672k points)
selected by
Best 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.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.