mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 21:24:53 +08:00
Remove center-table from docs.
Add header to the tables.
This commit is contained in:
@ -40,8 +40,7 @@
|
||||
- 将当前树在 `inorder` 中的索引区间记为 $[l, r]$ 。
|
||||
|
||||
如下表所示,通过以上变量即可表示根节点在 `preorder` 中的索引,以及子树在 `inorder` 中的索引区间。
|
||||
|
||||
<div class="center-table" markdown>
|
||||
<p align="center"> 表:根节点和子树在前序和中序遍历中的索引 </p>
|
||||
|
||||
| | 根节点在 `preorder` 中的索引 | 子树在 `inorder` 中的索引区间 |
|
||||
| ------ | -------------------------------- | ----------------------------- |
|
||||
@ -49,8 +48,6 @@
|
||||
| 左子树 | $i + 1$ | $[l, m-1]$ |
|
||||
| 右子树 | $i + 1 + (m - l)$ | $[m+1, r]$ |
|
||||
|
||||
</div>
|
||||
|
||||
请注意,右子树根节点索引中的 $(m-l)$ 的含义是“左子树的节点数量”,建议配合下图理解。
|
||||
|
||||

|
||||
|
||||
Reference in New Issue
Block a user