mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 12:58:42 +08:00
Remove center-table from docs.
Add header to the tables.
This commit is contained in:
@ -20,8 +20,7 @@
|
||||
实际上,**堆通常用作实现优先队列,大顶堆相当于元素按从大到小顺序出队的优先队列**。从使用角度来看,我们可以将「优先队列」和「堆」看作等价的数据结构。因此,本书对两者不做特别区分,统一使用「堆」来命名。
|
||||
|
||||
堆的常用操作见下表,方法名需要根据编程语言来确定。
|
||||
|
||||
<div class="center-table" markdown>
|
||||
<p align="center"> 表:堆的操作效率 </p>
|
||||
|
||||
| 方法名 | 描述 | 时间复杂度 |
|
||||
| --------- | ------------------------------------------ | ----------- |
|
||||
@ -31,8 +30,6 @@
|
||||
| size() | 获取堆的元素数量 | $O(1)$ |
|
||||
| isEmpty() | 判断堆是否为空 | $O(1)$ |
|
||||
|
||||
</div>
|
||||
|
||||
在实际应用中,我们可以直接使用编程语言提供的堆类(或优先队列类)。
|
||||
|
||||
!!! tip
|
||||
|
||||
Reference in New Issue
Block a user