Prioqueue v0.2.7 Prioqueue.Implementations.PairingHeap View Source
An implementation of a Priority Queue built on top of a Pairing Heap.
Pairing Heaps are nearly as simple as Skew Heaps but are in many contexts the fastest kind of priority queue implementation known.
Pairing Heaps have amortized time bounds.
More information about Pairing Heaps can be found in Issue #16 of the Monad.Reader.
Link to this section Summary
Functions
Callback implementation for FunLand.Semicombinable.combine/2
.
A variant of reduce that accepts anything that is Combinable as second argument. This Combinable will determine what the empty value and the combining operation will be.
Callback implementation for FunLand.Reducable.reduce/3
.
Converts the reducable into a list, by building up a list from all elements, and in the end reversing it.
Link to this section Functions
combine(pairing_heap1, pairing_heap2) View Source
Callback implementation for FunLand.Semicombinable.combine/2
.
empty(opts \\ []) View Source
reduce(a, combinable) View Source
A variant of reduce that accepts anything that is Combinable as second argument. This Combinable will determine what the empty value and the combining operation will be.
Pass in the combinable module name to start with empty
as accumulator,
or the combinable as struct to use that as starting accumulator.
reduce(prioqueue, acc, fun) View Source
Callback implementation for FunLand.Reducable.reduce/3
.
to_list(reducable) View Source
Converts the reducable into a list, by building up a list from all elements, and in the end reversing it.
This is an automatic function implementation, made possible because Prioqueue.Implementations.PairingHeap
implements the FunLand.Reducable
behaviour.