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

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -0,0 +1,65 @@
<p>给定一棵二叉树的根节点&nbsp;<code>root</code> ,请找出该二叉树中每一层的最大值。</p>
<p>&nbsp;</p>
<p><strong>示例1</strong></p>
<pre>
<strong>输入: </strong>root = [1,3,2,5,3,null,9]
<strong>输出: </strong>[1,3,9]
<strong>解释:</strong>
1
/ \
3 2
/ \ \
5 3 9
</pre>
<p><strong>示例2</strong></p>
<pre>
<strong>输入: </strong>root = [1,2,3]
<strong>输出: </strong>[1,3]
<strong>解释:</strong>
1
/ \
2 3
</pre>
<p><strong>示例3</strong></p>
<pre>
<strong>输入: </strong>root = [1]
<strong>输出: </strong>[1]
</pre>
<p><strong>示例4</strong></p>
<pre>
<strong>输入: </strong>root = [1,null,2]
<strong>输出: </strong>[1,2]
<strong>解释:</strong>
&nbsp; 1
&nbsp; \
&nbsp; 2
</pre>
<p><strong>示例5</strong></p>
<pre>
<strong>输入: </strong>root = []
<strong>输出: </strong>[]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li>二叉树的节点个数的范围是 <code>[0,10<sup>4</sup>]</code></li>
<li><meta charset="UTF-8" /><code>-2<sup>31</sup>&nbsp;&lt;= Node.val &lt;= 2<sup>31</sup>&nbsp;- 1</code></li>
</ul>
<p>&nbsp;</p>
<p><meta charset="UTF-8" />注意:本题与主站 515&nbsp;题相同:&nbsp;<a href="https://leetcode-cn.com/problems/find-largest-value-in-each-tree-row/">https://leetcode-cn.com/problems/find-largest-value-in-each-tree-row/</a></p>