1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 19:18:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/算法题(国内版)/problem (Chinese)/从上到下打印二叉树 [cong-shang-dao-xia-da-yin-er-cha-shu-lcof].html

27 lines
412 B
HTML
Raw Normal View History

2022-03-27 20:38:29 +08:00
<p>从上到下打印出二叉树的每个节点,同一层的节点按照从左到右的顺序打印。</p>
<p>&nbsp;</p>
<p>例如:<br>
给定二叉树:&nbsp;<code>[3,9,20,null,null,15,7]</code>,</p>
<pre> 3
/ \
9 20
/ \
15 7
</pre>
<p>返回:</p>
<pre>[3,9,20,15,7]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ol>
<li><code>节点总数 &lt;= 1000</code></li>
</ol>