https://leetcode-cn.com/tag/binary-tree/problemset/
把题目的要求细化,搞清楚根节点应该做什么,然后剩下的事情抛给前/中/后序的遍历框架就可以
文章目录
226.翻转二叉树(简单)
https://leetcode-cn.com/problems/invert-binary-tree
114.二叉树展开为链表(中等)
https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-list
116.填充每个节点的下一个右侧节点指针(中等)
https://leetcode-cn.com/problems/populating-next-right-pointers-in-each-node
654.最大二叉树(中等)
https://leetcode-cn.com/problems/maximum-binary-tree/
*105.从前序与中序遍历序列构造二叉树(中等)
https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
*106.从中序与后序遍历序列构造二叉树(中等)
https://leetcode-cn.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/
94.二叉树的中序遍历 (简单) [递归以及非递归实现]
https://leetcode-cn.com/problems/binary-tree-inorder-traversal/
95.验证二叉搜索树(中等)
https://leetcode-cn.com/problems/validate-binary-search-tree/ #⚠️ 这道题辅助方法里面要传入lower,upper两个值,否则会有问题;或者直接用中序遍历来实现
100.相同的树 (简单)
https://leetcode-cn.com/problems/same-tree/
101. 对称二叉树(简单)
https://leetcode-cn.com/problems/symmetric-tree/
104. 二叉树的最大深度(简单)
https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/
111. 二叉树的最小深度(简单)
https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/
注意递归终止条件
112. 路径总和(简单)
https://leetcode-cn.com/problems/path-sum/
注意叶子结点这个定义 (与111类似)
404. 左叶子之和(简单)
https://leetcode-cn.com/problems/sum-of-left-leaves/
144. 二叉树的前序遍历(简单)
https://leetcode-cn.com/problems/binary-tree-preorder-traversal/
145. 二叉树的后序遍历(简单)
https://leetcode-cn.com/problems/binary-tree-postorder-traversal/