Invert a binary tree.
4 / \ 2 7 / \ / \ 1 3 6 9to
4 / \ 7 2 / \ / \ 9 6 3 1
题意:翻转二叉树
分类:二叉树
解法1:递归。交换左右子节点,然后递归交换左右子树。
原文链接http://blog.csdn.net/crazy__chen/article/details/46484457
Invert a binary tree.
4 / \ 2 7 / \ / \ 1 3 6 9to
4 / \ 7 2 / \ / \ 9 6 3 1
题意:翻转二叉树
分类:二叉树
解法1:递归。交换左右子节点,然后递归交换左右子树。
原文链接http://blog.csdn.net/crazy__chen/article/details/46484457