
ZOJ Problem Set  1470
The balanced binary tree is defined recursively as follows: 1. The difference in the depth of its left child tree and right child tree is at most 1. 2. Its left child tree is a balanced binary tree. 3. Its right child tree is also a balanced binary tree. Now it is your job to calculate the number of balanced binary trees with given number of nodes and leaves.
Author: TANG, Jiqing Source: ZOJ Monthly, December 2002 