Number of full binary trees is Catalan, What is the number of Binary trees?

1k Views Asked by At

In exercise 12-4 of "Introduction to Algorithms" by Cormen et.al (third edition), they mention that the number of Binary trees with $n$ nodes is given by the Catalan numbers,

$$b_n = \frac{1}{n+1}{2n \choose n}$$

In the Wikipedia article on Catalan numbers here however, they say that this is the number of "Full binary trees". Meaning every node has zero or two children.

This seems to be an apparent contradiction. Is this an omission in Cormen's book? Or is the Wikipedia article incorrect? And if $b_n$ is the number of full binary trees with $n$ nodes, what is the number of binary trees? And why should only one of them satisfy the recurrence given in part-a of exercise 12-4:

$$b_n = \sum_{k=0}^{n-1}b_k b_{n-1-k}$$

1

There are 1 best solutions below

3
On BEST ANSWER

You omitted an essential part of the Wikipedia statement: $C_n$ is the count of full binary trees with $n+1$ leaves, not with $n$ nodes as in the other statement. So there’s no contradiction; both statements are correct.