1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/判断对称二叉树 [dui-cheng-de-er-cha-shu-lcof].html
2023-12-09 18:53:53 +08:00

32 lines
1.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>请设计一个函数判断一棵二叉树是否 <strong>轴对称</strong></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<p><img alt="" src="https://pic.leetcode.cn/1694689008-JaaRdV-%E8%BD%B4%E5%AF%B9%E7%A7%B0%E4%BA%8C%E5%8F%89%E6%A0%911.png" /></p>
<pre>
<strong>输入:</strong>root = [6,7,7,8,9,9,8]
<strong>输出:</strong>true
<strong>解释:</strong>从图中可看出树是轴对称的。</pre>
<p><strong>示例 2</strong></p>
<p><img alt="" src="https://pic.leetcode.cn/1694689054-vENzHe-%E8%BD%B4%E5%AF%B9%E7%A7%B0%E4%BA%8C%E5%8F%89%E6%A0%912.png" /></p>
<pre>
<strong>输入:</strong>root = [1,2,2,null,3,null,3]
<strong>输出:</strong>false
<strong>解释:</strong>从图中可看出最后一层的节点不对称。</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<p><code>0 &lt;= 节点个数 &lt;= 1000</code></p>
<p>注意:本题与主站 101 题相同:<a href="https://leetcode-cn.com/problems/symmetric-tree/">https://leetcode-cn.com/problems/symmetric-tree/</a></p>
<p>&nbsp;</p>