Fully managed library providing five types of heap. It implements d-ary, binary, binomial, Fibonacci and pairing heaps, in order to let the user choose the best heap to fit her needs. Each heap has its own advantages and disadvantages: please see the documentation or Wikipedia to better understand how those data structures work and how they behave in each operation.


Keywords
heap, binary, binomial, pairing, fibonacci, priority, queue, ternary, quaternary, stable
License
MIT
Install
Install-Package Hippie -Version 2.10.1

Documentation

Fully managed library providing five types of heap.

Item URL
NuGet package https://nuget.org/packages/Hippie/
NuGet package (unchecked) https://nuget.org/packages/Hippie.Unchecked/
Tutorial TODO
Documentation (HTML) http://pomma89.altervista.org/hippie/html/index.html
Documentation (PDF) http://pomma89.altervista.org/hippie/refman.pdf

Currently implemented heaps are:

Heap type Wikipedia page
Array https://en.wikipedia.org/wiki/D-ary_heap
Binary https://en.wikipedia.org/wiki/Binary_heap
Binomial https://en.wikipedia.org/wiki/Binomial_heap
Fibonacci https://en.wikipedia.org/wiki/Fibonacci_heap
Pairing https://en.wikipedia.org/wiki/Pairing_heap

For example, using this library you can write a very simple heap sort in this way:

T[] HeapSort<T>(IEnumerable<T> elems) where T : IComparable<T>
{
    var heap = HeapFactory.NewBinaryHeap<T>();
    foreach (var elem in elems) {
        heap.Add(elem);
    }
    var orderedElems = new T[heap.Count];
    for (var i = 0; heap.Count > 0; ++i) {
        orderedElems[i] = heap.RemoveMin();
    }
    return orderedElems;
}