
堆
文章平均质量分 66
zadarmo_
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
堆和堆排序
堆是一种优先队列,堆有两个特性:结构性:用数组表示的完全二叉树;有序性:任一结点的关键字是其子树所有结点的最值。如果是最大值,则成为最大堆;如果是最小值,称为最小堆。基于第一个特性,可以用一个一维数组去存这个堆,起始下标为1。对于堆的操作,下面只给出最大堆的插入和删除的操作。插入元素如图所示:其主要思想是:先将元素放入数组的最后一个位置将这个元素进行向上调整代码如下...原创 2019-08-04 17:24:05 · 203 阅读 · 0 评论 -
1147 Heaps (30 分)——甲级(堆)
In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (i...原创 2019-08-17 13:35:53 · 120 阅读 · 0 评论 -
1155 Heap Paths (30 分)——甲级(堆+dfs回溯)
In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (i...原创 2019-08-17 14:06:29 · 195 阅读 · 0 评论