Remove center-table from docs.

Add header to the tables.
This commit is contained in:
krahets
2023-08-19 19:22:08 +08:00
parent 4eb621dda7
commit 70227c82cb
18 changed files with 26 additions and 78 deletions
+1 -4
View File
@@ -310,8 +310,7 @@
给定一组数据,我们考虑使用数组或二叉搜索树存储。
观察可知,二叉搜索树的各项操作的时间复杂度都是对数阶,具有稳定且高效的性能表现。只有在高频添加、低频查找删除的数据适用场景下,数组比二叉搜索树的效率更高。
<div class="center-table" markdown>
<p align="center"> 表:数组与搜索树的效率对比 </p>
| | 无序数组 | 二叉搜索树 |
| -------- | -------- | ----------- |
@@ -319,8 +318,6 @@
| 插入元素 | $O(1)$ | $O(\log n)$ |
| 删除元素 | $O(n)$ | $O(\log n)$ |
</div>
在理想情况下,二叉搜索树是“平衡”的,这样就可以在 $\log n$ 轮循环内查找任意节点。
然而,如果我们在二叉搜索树中不断地插入和删除节点,可能导致二叉树退化为链表,这时各种操作的时间复杂度也会退化为 $O(n)$ 。