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
Get step-by-step solutions from verified subject matter experts
