Question: Consider a binary tree in which each node has exactly: 2 (two) children (internal node) OR 0 (zero) children (leaf node). Let L denote the

Consider a binary tree in which each node has exactly: 2 (two) children (internal node) OR 0 (zero) children (leaf node). Let L denote the sum of the depths of all leaf nodes. Let I denote the sum of the depths of all internal nodes. Prove that: L = I + (n-1) where n is the number of nodes in the tree. You may assume n >= 1.

Prove by induction.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!