1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 19:31:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<p>请完成一个函数,输入一个二叉树,该函数输出它的镜像。</p>
<p>例如输入:</p>
<p><code>&nbsp; &nbsp; &nbsp;4<br>
&nbsp; &nbsp;/ &nbsp; \<br>
&nbsp; 2 &nbsp; &nbsp; 7<br>
&nbsp;/ \ &nbsp; / \<br>
1 &nbsp; 3 6 &nbsp; 9</code><br>
镜像输出:</p>
<p><code>&nbsp; &nbsp; &nbsp;4<br>
&nbsp; &nbsp;/ &nbsp; \<br>
&nbsp; 7 &nbsp; &nbsp; 2<br>
&nbsp;/ \ &nbsp; / \<br>
9 &nbsp; 6 3&nbsp; &nbsp;1</code></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>root = [4,2,7,1,3,6,9]
<strong>输出:</strong>[4,7,2,9,6,3,1]
</pre>
<p>&nbsp;</p>
<p><strong>限制:</strong></p>
<p><code>0 &lt;= 节点个数 &lt;= 1000</code></p>
<p>注意:本题与主站 226 题相同:<a href="https://leetcode-cn.com/problems/invert-binary-tree/">https://leetcode-cn.com/problems/invert-binary-tree/</a></p>