generate all structurally distinct full binary trees with n leaves
问题 This is a homework, I have difficulties in thinking of it. Please give me some ideas on recursions and DP solutions. Thanks a lot generate and print all structurally distinct full binary trees with n leaves in dotted parentheses form, "full" means all internal (non-leaf) nodes have exactly two children. For example, there are 5 distinct full binary trees with 4 leaves each. 回答1: U can use recursion, on i-th step u consider i-th level of tree and u chose which nodes will be present on this