1.检查两颗树是否相同
https://leetcode.cn/problems/same-tree/

分成子问题和结束条件 ,这里用前序的思想解题(先判断根,再左右子树),不然会很浪费时间。假如左右相等,最后根不同,白白比较了 。
下面是代码题解

2.单值二叉树
https://leetcode.cn/problems/univalued-binary-tree/description/
这个题利用交换律,画出递归图更容易理解


下面是递归图

3.对称二叉树
https://leetcode.cn/problems/symmetric-tree/description/

如果没有想要的接口,可以自己去调用,但是不能去删除原接口。

4.二叉树的前序遍历
https://leetcode.cn/problems/binary-tree-preorder-traversal/description/




















