Given an integer n, the task is to find all possible Full Binary Trees with n nodes. The value at the nodes does not contribute to be a criteria for different Full Binary Tree, except for NULL,so take them as 0.
A full binary tree is a binary tree in which every node has exactly 0 or 2 children.
The simplest way to solve the problem is to use recursion using the concept of memoization and check for each subtree if there is a odd number of nodes or not, because a full binary tree has odd nodes.
Below is the implementation of the above approach: