Total Accepted: 67715
Total Submissions: 155630
Difficulty: Easy
Invert a binary tree.
4 / \ 2 7 / \ / \ 1 3 6 9
to
4 / \ 7 2 / \ / \ 9 6 3 1
一种是用递归,一种是用栈,代码如下
C++:
1 | /** |
select * from utils
Total Accepted: 67715
Total Submissions: 155630
Difficulty: Easy
Invert a binary tree.
4 / \ 2 7 / \ / \ 1 3 6 9
to
4 / \ 7 2 / \ / \ 9 6 3 1
一种是用递归,一种是用栈,代码如下
C++:
1 | /** |
欢迎加入我的小专栏「基你太美」一起学习。