226. Invert Binary Tree [LeetCode]
来源:互联网 发布:研究生小论文数据造假 编辑:程序博客网 时间:2024/06/03 10:59
Invert a binary tree.
4 / \ 2 7 / \ / \1 3 6 9to
4 / \ 7 2 / \ / \9 6 3 1Trivia:
This problem was inspired by this original tweet by Max Howell:
Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.
本题就是传说中的翻转二叉树。。题目意思简单明了。。实现也十分简单。。给出一个思路:先对root的左右子树交换,再对左右子树进行递归处理;递归的结束条件是root为null。
具体的java实现代码如下:
0 0
- LeetCode 226. Invert Binary Tree
- [leetcode] 226.Invert Binary Tree
- [leetcode] 226. Invert Binary Tree
- 【LeetCode】226. Invert Binary Tree
- leetCode 226. Invert Binary Tree
- LeetCode #226. Invert Binary Tree
- [LeetCode]226. Invert Binary Tree
- 226. Invert Binary Tree LeetCode
- LeetCode 226. Invert Binary Tree
- LeetCode 226. Invert Binary Tree
- leetcode:226. Invert Binary Tree
- LeetCode 226. Invert Binary Tree
- [LeetCode]226. Invert Binary Tree
- leetcode 226. Invert Binary Tree
- 【LeetCode】226. Invert Binary Tree
- #leetcode#226. Invert Binary Tree
- LeetCode *** 226. Invert Binary Tree
- leetcode: 226. Invert Binary Tree
- HDU 5412 CRB and Queries(整体二分 | CDQ分治)
- HDU 5732 Subway(树同构)
- 简单的二分查找条件
- c/c++ 练习笔记
- 第17章 控件模版(4)——事件触发器
- 226. Invert Binary Tree [LeetCode]
- poj 1111 dfs求面积问题
- spring data elasticsearch在集群新建了索引出现unsigned
- Oracle常用字符集
- powershell如何ping
- .htaccess .htpasswd 访问密码设置
- css3 transform
- CS0012: 类型“System.Web.Routing.RouteValueDictionary”在未被引用的程序集中定义。必须添加对程序集“System.Web.Routing, Version
- hook Android系统调用的乐趣和好处