Mergeable heaps

前言

    本文目的在于对几种构建可合并堆的方式进行整体比较;并对每种方式分别从伪代码,具体实现,消耗计算等三方面进行总结;以达到对该类型问题有较清楚的认识。html

简介

     可合并堆是指对外提供如下接口的堆算法

  1. MAKE-HEAP( ) creates and returns a new heap containing no elements.this

  2. INSERT(H,x) inserts element x, whose key has already been filled in, into heap H. MINIMUM(H) returns a pointer to the element in heap H whose key is minimum.spa

  3. EXTRACT-MIN(H) deletes the element from heap H whose key is minimum, returning a pointer to the element.htm

  4. UNION(H1;H2) creates and returns a new heap that contains all the elements of
    heaps H1 and H2. Heaps H1 and H2 are “destroyed” by this operation.
    blog


    In addition to the mergeable-heap operations above, Fibonacci heaps also support
    the following two operations:
    接口

  5. DECREASE-KEY(H, x, k) assigns to element x within heap H the new key
    value k, which we assume to be no greater than its current key value.
    ci

  6. DELETE(H, x) deletes element x from heap H.element

实现方式整体比较



参考文章

  1. 算法导论 第三版get

  2. http://www.cnblogs.com/xuqiang/archive/2011/06/01/2065549.html

IN BUILDING

相关文章
相关标签/搜索