ck/heap▲toc

Pairing heap

Reference:

Warning: this implementation is slow.

type pairing-heapck/heap/pairing-heap: V -> V<a>

Create an empty heap. compck/heap/comp: forall<a> (pairing-heap<a>) -> ((a, a) -> order) determines the order of elements in the heap.

Remove the minimum element from a heap. Do nothing if the given heap is empty.

Check whether a heap is empty.

Combine two heaps. Assume they use the same ordering function.

Return the minimum element of a heap.

Create a heap with a single element. compck/heap/comp: forall<a> (pairing-heap<a>) -> ((a, a) -> order) determines the order of elements in the heap.

private import std/core/typesstd/core/types, std/corestd/core