
堆(优先队列)
文章平均质量分 80
ccDLlyy
不忘初心,方得始终
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
二叉堆
//Binary Heap,the most common implement of Poriority Queen(Heap)//以最小堆为例#include #include #include struct heapNode{ int capacity; int size; int *data;};struct heapNode* Init(struct heapNode*原创 2016-11-14 23:02:30 · 531 阅读 · 0 评论 -
左偏树
左偏树(Leftist Tree)是一种可并堆(Mergeable Heap) ,它除了支持优先队列的三个基本操作(插入,删除,取最小节点),还支持一个很特殊的操作——合并操作左偏树是一棵二叉树,它的节点除了和二叉树的节点一样具有左右子树指针( left, right)外,还有两个属性:键值和距离(dist)。键值是用于比较节点的大小。距离则是如下定义的: 节点i称为外节点(ext原创 2017-07-12 16:03:21 · 1030 阅读 · 0 评论