My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for

Contents

Complete wiki list

Heap  
The Heap data structure
Updated Aug 12, 2009 by hus...@gmail.com
[Serializable]
public class Heap<T> : IVisitableCollection<T>, IHeap<T>
{
    // Methods
    public T RemoveRoot();
    public void Add(T item);	
    // ...
    
    // Properties
    public int Count { get; }    
    public T Root { get; }
    public HeapType Type { get; }
    // ...    
}

The Heap data structure is a tree structure with a special property: either the smallest item (a Min-Heap) or the largest item (a Max-Heap) is contained in the root of the tree. The Heap implemented in this library can either be a Min-Heap or a Max-Heap, and is set on the constructor. For a Max-Heap, the IComparer<T> instance used is wrapped in a ReverseComparer<IComparer<T>> instance, thus reversing the comparison decision and sorting in the opposite order.

More information on Heaps


Sign in to add a comment
Powered by Google Project Hosting