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)/二叉树的中序遍历 [binary-tree-inorder-traversal].html
2022-03-29 12:43:11 +08:00

38 lines
919 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>给定一个二叉树的根节点 <code>root</code> ,返回 <em>它的 <strong>中序</strong>&nbsp;遍历</em></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/09/15/inorder_1.jpg" style="height: 200px; width: 125px;" />
<pre>
<strong>输入:</strong>root = [1,null,2,3]
<strong>输出:</strong>[1,3,2]
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>root = []
<strong>输出:</strong>[]
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>root = [1]
<strong>输出:</strong>[1]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点数目在范围 <code>[0, 100]</code></li>
<li><code>-100 &lt;= Node.val &lt;= 100</code></li>
</ul>
<p>&nbsp;</p>
<p><strong>进阶:</strong>&nbsp;递归算法很简单,你可以通过迭代算法完成吗?</p>