mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 03:11:42 +08:00
update
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<p>某公司架构以二叉树形式记录,请返回该公司的层级数。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<p><img alt="" src="https://pic.leetcode.cn/1695101942-FSrxqu-image.png" /></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>root = [1, 2, 2, 3, null, null, 5, 4, null, null, 4]
|
||||
<strong>输出: </strong>4
|
||||
<strong>解释: </strong>上面示例中的二叉树的最大深度是 4,沿着路径 1 -> 2 -> 3 -> 4 或 1 -> 2 -> 5 -> 4 到达叶节点的最长路径上有 4 个节点。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>节点总数 <= 10000</code></li>
|
||||
</ul>
|
||||
|
||||
<p>注意:本题与主站 104 题相同:<a href="https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/">https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/</a></p>
|
||||
|
||||
<p> </p>
|
Reference in New Issue
Block a user