摘要:
https://leetcode-cn.com/problems/populating-next-right-pointers-in-each-node/ 看代码,很容易理解 class Solution { public Node connect(Node root) { if (root == 阅读全文
摘要:
https://leetcode-cn.com/problems/invert-binary-tree/ 翻转整棵树就是交换每个节点的左右子节点,于是把交换左右子节点的代码放在了前序遍历的位置 把交换左右子节点的代码复制粘贴到后序遍历的位置也可以 class Solution { public Tr 阅读全文