How many nodes does a leftist tree with r nodes must have?

Category: QuestionsHow many nodes does a leftist tree with r nodes must have?
Editor">Editor Staff asked 4 weeks ago

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 Answers
Editor">Editor Staff answered 4 weeks ago

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.