FSharpx.Collections


BinomialHeap<'T> Type

Constructors

Constructor Description

BinomialHeap(isDescending, heap)

Full Usage: BinomialHeap(isDescending, heap)

Parameters:
Returns: BinomialHeap<'T>
isDescending : bool
heap : BinomialTree<'T> list
Returns: BinomialHeap<'T>

Instance members

Instance member Description

this.Head()

Full Usage: this.Head()

Returns: 'T

O(log n). Returns the min or max element.

Returns: 'T

this.Insert(x)

Full Usage: this.Insert(x)

Parameters:
    x : 'T

Returns: BinomialHeap<'T>

O(log n). Returns a new heap with the element inserted.

x : 'T
Returns: BinomialHeap<'T>

this.IsDescending

Full Usage: this.IsDescending

Returns: bool

O(1). Returns true if the heap has max element at head.

Returns: bool

this.IsEmpty

Full Usage: this.IsEmpty

Returns: bool

O(1). Returns true if the heap has no elements.

Returns: bool

this.Length()

Full Usage: this.Length()

Returns: int

O(log n). Returns the count of elements.

Returns: int

this.Merge(xs)

Full Usage: this.Merge(xs)

Parameters:
Returns: BinomialHeap<'T>

O(log n). Returns heap from merging two heaps, both must have same isDescending.

xs : BinomialHeap<'T>
Returns: BinomialHeap<'T>

this.Tail()

Full Usage: this.Tail()

Returns: BinomialHeap<'T>

O(log n). Returns a new heap of the elements trailing the head.

Returns: BinomialHeap<'T>

this.TryGetHead()

Full Usage: this.TryGetHead()

Returns: 'T option

O(log n). Returns option first min or max element.

Returns: 'T option

this.TryGetTail()

Full Usage: this.TryGetTail()

Returns: BinomialHeap<'T> option

O(log n). Returns option heap of the elements trailing the head.

Returns: BinomialHeap<'T> option

this.TryMerge(xs)

Full Usage: this.TryMerge(xs)

Parameters:
Returns: BinomialHeap<'T> option

O(log n). Returns heap option from merging two heaps.

xs : BinomialHeap<'T>
Returns: BinomialHeap<'T> option

this.TryUncons()

Full Usage: this.TryUncons()

Returns: ('T * BinomialHeap<'T>) option

O(log n). Returns option head element and tail.

Returns: ('T * BinomialHeap<'T>) option

this.Uncons()

Full Usage: this.Uncons()

Returns: 'T * BinomialHeap<'T>

O(log n). Returns the head element and tail.

Returns: 'T * BinomialHeap<'T>