How to find the number of non-isomorphic binary trees with $n$ nodes?

468 Views Asked by At

A binary tree can have at most two children.

Two trees are called isomorphic if one of them can be obtained from other by a series of flips, i.e. by swapping left and right children of a number of nodes. Any number of nodes at any level can have their children swapped. Two empty trees are isomorphic.

The idea is to create an array of integers whose $i^{th}$ term will store number of such tree with $i$ nodes.