1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-25 17:50:26 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/对称二叉树 [symmetric-tree].html

31 lines
889 B
HTML
Raw Normal View History

2022-03-27 20:56:26 +08:00
<p>给你一个二叉树的根节点 <code>root</code> 检查它是否轴对称。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
2023-12-09 18:42:21 +08:00
<img alt="" src="https://pic.leetcode.cn/1698026966-JDYPDU-image.png" style="width: 354px; height: 291px;" />
2022-03-27 20:56:26 +08:00
<pre>
<strong>输入:</strong>root = [1,2,2,3,4,4,3]
<strong>输出:</strong>true
</pre>
<p><strong>示例 2</strong></p>
2023-12-09 18:42:21 +08:00
<img alt="" src="https://pic.leetcode.cn/1698027008-nPFLbM-image.png" style="width: 308px; height: 258px;" />
2022-03-27 20:56:26 +08:00
<pre>
<strong>输入:</strong>root = [1,2,2,null,3,null,3]
<strong>输出:</strong>false
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点数目在范围 <code>[1, 1000]</code></li>
<li><code>-100 &lt;= Node.val &lt;= 100</code></li>
</ul>
<p>&nbsp;</p>
<p><strong>进阶:</strong>你可以运用递归和迭代两种方法解决这个问题吗?</p>