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

相關文章
相關標籤/搜索