110. 平衡二叉树 https://leetcode.cn/problems/balanced-binary-tree
110. Balanced Binary Tree https://leetcode.com/problems/balanced-binary-tree
250. 统计同值子树 https://leetcode.cn/problems/count-univalue-subtrees
250. Count Univalue Subtrees https://leetcode.com/problems/count-univalue-subtrees
333. 最大 BST 子树 https://leetcode.cn/problems/largest-bst-subtree
333. Largest BST Subtree https://leetcode.com/problems/largest-bst-subtree
366. 寻找二叉树的叶子节点 https://leetcode.cn/problems/find-leaves-of-binary-tree
366. Find Leaves of Binary Tree https://leetcode.com/problems/find-leaves-of-binary-tree
508. 出现次数最多的子树元素和 https://leetcode.cn/problems/most-frequent-subtree-sum
508. Most Frequent Subtree Sum https://leetcode.com/problems/most-frequent-subtree-sum
563. 二叉树的坡度 https://leetcode.cn/problems/binary-tree-tilt
563. Binary Tree Tilt https://leetcode.com/problems/binary-tree-tilt
549. 二叉树中最长的连续序列 https://leetcode.cn/problems/binary-tree-longest-consecutive-sequence-ii
549. Binary Tree Longest Consecutive Sequence II https://leetcode.com/problems/binary-tree-longest-consecutive-sequence-ii
1325. 删除给定值的叶子节点 https://leetcode.cn/problems/delete-leaves-with-a-given-value
1325. Delete Leaves With a Given Value https://leetcode.com/problems/delete-leaves-with-a-given-value
有些题目,你按照拍脑袋的方式去做,可能发现需要在递归代码中调用其他递归函数计算字数的信息。一般来说,出现这种情况时你可以考虑用后序遍历的思维方式来优化算法,利用后序遍历传递子树的信息,避免过高的时间复杂度。
loading...