Add summary for the chapters of introduction, hashing, heap, graph, sorting

This commit is contained in:
krahets
2023-02-26 22:47:21 +08:00
parent 1a49631dba
commit c2d641537e
15 changed files with 78 additions and 19 deletions
+2 -2
View File
@@ -10,7 +10,7 @@
### 基于堆化操作实现
然而,**存在一种更加高效的建堆方法**。设结点数量为 $n$ ,我们先将列表所有元素原封不动添加进堆,**然后迭代地对各个结点执行「从顶至底堆化」**。当然,**无需对叶结点执行堆化**,因为其没有子结点。
然而,**存在一种更加高效的建堆方法**。设元素数量为 $n$ ,我们先将列表所有元素原封不动添加进堆,**然后迭代地对各个结点执行「从顶至底堆化」**。当然,**无需对叶结点执行堆化**,因为其没有子结点。
=== "Java"
@@ -89,7 +89,7 @@ $$
T(h) = 2^0h + 2^1(h-1) + 2^2(h-2) + \cdots + 2^{(h-1)}\times1
$$
![完美二叉树的各层结点数量](heap.assets/heapify_operations_count.png)
![完美二叉树的各层结点数量](build_heap.assets/heapify_operations_count.png)
化简上式需要借助中学的数列知识,先对 $T(h)$ 乘以 $2$ ,易得