This commit is contained in:
krahets
2023-02-26 19:53:26 +08:00
parent cf26cd551a
commit 9cd475d8c2
29 changed files with 180 additions and 0 deletions
+6
View File
@@ -11,6 +11,8 @@ comments: true
![小顶堆与大顶堆](heap.assets/min_heap_and_max_heap.png)
<p align="center"> Fig. 小顶堆与大顶堆 </p>
## 8.1.1. &nbsp; 堆术语与性质
- 由于堆是完全二叉树,因此最底层结点靠左填充,其它层结点皆被填满。
@@ -318,6 +320,8 @@ comments: true
![堆的表示与存储](heap.assets/representation_of_heap.png)
<p align="center"> Fig. 堆的表示与存储 </p>
我们将索引映射公式封装成函数,以便后续使用。
=== "Java"
@@ -1427,6 +1431,8 @@ $$
![完美二叉树的各层结点数量](heap.assets/heapify_operations_count.png)
<p align="center"> Fig. 完美二叉树的各层结点数量 </p>
化简上式需要借助中学的数列知识,先对 $T(h)$ 乘以 $2$ ,易得
$$