Show / Hide Table of Contents

    Class BinomialHeap<T>

    A binomial minMax heap implementation.

    Inheritance
    Object
    BinomialHeap<T>
    Namespace: Advanced.Algorithms.DataStructures
    Assembly: Advanced.Algorithms.dll
    Syntax
    public class BinomialHeap<T> : IEnumerable<T> where T : IComparable
    Type Parameters
    Name Description
    T

    Constructors

    BinomialHeap(SortDirection)

    Declaration
    public BinomialHeap(SortDirection sortDirection = null)
    Parameters
    Type Name Description
    SortDirection sortDirection

    Properties

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    Int32

    Methods

    Extract()

    Time complexity: O(log(n)).

    Declaration
    public T Extract()
    Returns
    Type Description
    T

    GetEnumerator()

    Declaration
    public IEnumerator<T> GetEnumerator()
    Returns
    Type Description
    IEnumerator<T>

    Insert(T)

    Time complexity: O(log(n)).

    Declaration
    public void Insert(T newItem)
    Parameters
    Type Name Description
    T newItem

    Merge(BinomialHeap<T>)

    Time complexity: O(log(n)).

    Declaration
    public void Merge(BinomialHeap<T> binomialHeap)
    Parameters
    Type Name Description
    BinomialHeap<T> binomialHeap

    The heap to union with.

    Peek()

    Time complexity: O(log(n)).

    Declaration
    public T Peek()
    Returns
    Type Description
    T

    UpdateKey(T, T)

    Time complexity: O(log(n)).

    Declaration
    public void UpdateKey(T currentValue, T newValue)
    Parameters
    Type Name Description
    T currentValue

    The value to update.

    T newValue

    The updated new value.

    Back to top Generated by DocFX