【Leetcode 226】Invert Binary Tree
难度: 简单(Easy)
题目:
Invert a binary tree.
4
/
2 7
/ \ /
1 3 6 9
to
4
/
7 2
/ \ /
9 6 3 1
代码:递归处理即可
1 | def invertTree(self, root): |
难度: 简单(Easy)
题目:
Invert a binary tree.
4
/
2 7
/ \ /
1 3 6 9
to
4
/
7 2
/ \ /
9 6 3 1
代码:递归处理即可
1 | def invertTree(self, root): |
评论系统未开启,无法评论!