leetcode894】的更多相关文章

A full binary tree is a binary tree where each node has exactly 0 or 2 children. Return a list of all possible full binary trees with N nodes.  Each element of the answer is the root node of one possible tree. Each node of each tree in the answer mus…
class Solution { private Map<Integer, List<TreeNode>> memo; public List<TreeNode> allPossibleFBT(int N) { this.memo = new HashMap<>(); return backtrack(N); } private List<TreeNode> backtrack(int n) { List<TreeNode> ret…