1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/翻转二叉树 [er-cha-shu-de-jing-xiang-lcof].html

28 lines
775 B
HTML
Raw Normal View History

2023-12-09 18:53:53 +08:00
<p>给定一棵二叉树的根节点 <code>root</code>,请左右翻转这棵二叉树,并返回其根节点。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<p><img alt="" src="https://pic.leetcode.cn/1694686821-qlvjod-%E7%BF%BB%E8%BD%AC%E4%BA%8C%E5%8F%89%E6%A0%91.png" /></p>
<pre>
<strong>输入:</strong>root = [5,7,9,8,3,2,4]
<strong>输出:</strong>[5,9,7,4,2,3,8]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点数目范围在 <code>[0, 100]</code></li>
<li><code>-100 &lt;= Node.val &lt;= 100</code></li>
</ul>
<p>&nbsp;</p>
<p>注意:本题与主站 226 题相同:<a href="https://leetcode-cn.com/problems/invert-binary-tree/">https://leetcode-cn.com/problems/invert-binary-tree/</a></p>
<p>&nbsp;</p>