leet-code/src/main/java/leetcode/editor/cn/InvertBinaryTree.md

25 lines
824 B
Markdown
Raw Normal View History

2021-07-20 16:34:21 +08:00
<p>翻转一棵二叉树。</p>
<p><strong>示例:</strong></p>
<p>输入:</p>
<pre> 4
/ \
2 7
/ \ / \
1 3 6 9</pre>
<p>输出:</p>
<pre> 4
/ \
7 2
/ \ / \
9 6 3 1</pre>
<p><strong>备注:</strong><br>
这个问题是受到 <a href="https://twitter.com/mxcl" target="_blank">Max Howell </a><a href="https://twitter.com/mxcl/status/608682016205344768" target="_blank">原问题</a> 启发的 </p>
<blockquote>谷歌我们90的工程师使用您编写的软件(Homebrew),但是您却无法在面试时在白板上写出翻转二叉树这道题,这太糟糕了。</blockquote>
<div><div>Related Topics</div><div><li></li><li>深度优先搜索</li><li>广度优先搜索</li><li>二叉树</li></div></div>\n<div><li>👍 919</li><li>👎 0</li></div>