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)/二叉树的深度 [er-cha-shu-de-shen-du-lcof].html
2022-03-29 12:43:11 +08:00

24 lines
682 B
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>输入一棵二叉树的根节点,求该树的深度。从根节点到叶节点依次经过的节点(含根、叶节点)形成树的一条路径,最长路径的长度为树的深度。</p>
<p>例如:</p>
<p>给定二叉树 <code>[3,9,20,null,null,15,7]</code></p>
<pre> 3
/ \
9 20
/ \
15 7</pre>
<p>返回它的最大深度&nbsp;3 。</p>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ol>
<li><code>节点总数 &lt;= 10000</code></li>
</ol>
<p>注意:本题与主站 104&nbsp;题相同:<a href="https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/">https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/</a></p>