mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-12 19:01:47 +08:00
批量更新数据
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
<p>给你二叉树的根结点 <code>root</code> ,请你设计算法计算二叉树的<em> </em><strong>垂序遍历</strong> 序列。</p>
|
||||
|
||||
<p>对位于 <code>(row, col)</code> 的每个结点而言,其左右子结点分别位于 <code>(row + 1, col - 1)</code> 和 <code>(row + 1, col + 1)</code> 。树的根结点位于 <code>(0, 0)</code> 。</p>
|
||||
<p>对位于 <code>(row, col)</code> 的每个结点而言,其左右子结点分别位于 <code>(row + 1, col - 1)</code> 和 <code>(row + 1, col + 1)</code> 。树的根结点位于 <code>(0, 0)</code> 。</p>
|
||||
|
||||
<p>二叉树的 <strong>垂序遍历</strong> 从最左边的列开始直到最右边的列结束,按列索引每一列上的所有结点,形成一个按出现位置从上到下排序的有序列表。如果同行同列上有多个结点,则按结点的值从小到大进行排序。</p>
|
||||
|
||||
<p>返回二叉树的 <strong>垂序遍历</strong> 序列。</p>
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
<p><strong class="example">示例 1:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/01/29/vtree1.jpg" style="width: 431px; height: 304px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong>root = [3,9,20,null,null,15,7]
|
||||
@@ -19,7 +19,7 @@
|
||||
列 1 :只有结点 20 在此列中。
|
||||
列 2 :只有结点 7 在此列中。</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
<p><strong class="example">示例 2:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/01/29/vtree2.jpg" style="width: 512px; height: 304px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong>root = [1,2,3,4,5,6,7]
|
||||
@@ -34,7 +34,7 @@
|
||||
列 2 :只有结点 7 在此列中。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
<p><strong class="example">示例 3:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/01/29/vtree3.jpg" style="width: 512px; height: 304px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong>root = [1,2,3,4,6,5,7]
|
||||
@@ -43,11 +43,11 @@
|
||||
这个示例实际上与示例 2 完全相同,只是结点 5 和 6 在树中的位置发生了交换。
|
||||
因为 5 和 6 的位置仍然相同,所以答案保持不变,仍然按值从小到大排序。</pre>
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li>树中结点数目总数在范围 <code>[1, 1000]</code> 内</li>
|
||||
<li><code>0 <= Node.val <= 1000</code></li>
|
||||
<li><code>0 <= Node.val <= 1000</code></li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user