mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-14 03:41:41 +08:00
add leetcode problem-cn part6
This commit is contained in:
30
算法题(国内版)/problem (Chinese)/对称二叉树 [symmetric-tree].html
Normal file
30
算法题(国内版)/problem (Chinese)/对称二叉树 [symmetric-tree].html
Normal file
@@ -0,0 +1,30 @@
|
||||
<p>给你一个二叉树的根节点 <code>root</code> , 检查它是否轴对称。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/02/19/symtree1.jpg" style="width: 354px; height: 291px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong>root = [1,2,2,3,4,4,3]
|
||||
<strong>输出:</strong>true
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/02/19/symtree2.jpg" style="width: 308px; height: 258px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong>root = [1,2,2,null,3,null,3]
|
||||
<strong>输出:</strong>false
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li>树中节点数目在范围 <code>[1, 1000]</code> 内</li>
|
||||
<li><code>-100 <= Node.val <= 100</code></li>
|
||||
</ul>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>进阶:</strong>你可以运用递归和迭代两种方法解决这个问题吗?</p>
|
Reference in New Issue
Block a user