MW UNITY NAMESPACE








































public class <T> : THeap<THeapInterface<T, T>, T>

MHeap


The implementation of a THeap without type constraints.


CONSTRUCTOR (SortFunc<T> HeapOrder)

Summary:

Generates a new Heap.

Remarks:

Initialised with an initial size of 32.

Params:

HeapOrder:

        The ordering in which to sort T in a heap.


CONSTRUCTOR (int InitialSize, SortFunc<T> HeapOrder)

Summary:

Generates a new Heap, initialised with MaxSize.

Params:

InitialSize:

        The size of the heap.

HeapOrder:

        The ordering in which to sort T in a heap.



public void

Push (T Element)

Summary:

Adds Element to the Heap.

Params:

Element:

        The Element to add.



public static MHeap<T>

Heapify (T[] Elements, SortFunc<T> SortFunc)

Summary:

Creates a Heap out of T[] Elements, ordered by SortFunc.

Params:

Elements:

        Elements to Heapify.

SortFunc:

        Priority queue function.

Returns:

A Heap with Elements ordered by SortFunc.



public static MHeap<T>

Heapify (SortFunc<T> SortFunc, T[] Elements)

Summary:

Params version of above.

Params:

SortFunc:

        Priority queue function.

Elements:

        Elements to Heapify.

Returns:

A Heap with Elements ordered by SortFunc.



public void

UpdateElement (T Element)

Summary:

Updates an Element's position in the Heap.

Params:

Element:

        The Element to update.



public bool

Contains (T Element)

Summary:

Whether or not Element exists in this Heap.

Params:

Element:

        The Element to search for.

Returns:

True if Element exists in the Heap. Otherwise, false.



protected virtual bool

EqualityCheck (T A, Y B)

Summary:

Equality Check for type T.

Returns:

True if A is considered equal to B.