297 views
1 votes
1 votes
Let C(X) be the number of leaves in a binary tree rooted at T. Assume that IsLeaf(T) returns I if T is a leaf. Which of the following observations leads to a recursive implementation?

C(T)=C(T.Left) +C(T.Right)

C(T):C(T.Left)+C(T.Right)+1

C(T)=C(T.Left]+C(T.right)+Isleaf(T)

1 Answer