FSharpx.Collections


BinomialHeap Module

Functions and values

Function or value Description

BinomialHeap.empty descending

Full Usage: BinomialHeap.empty descending

Parameters:
    descending : bool

Returns: BinomialHeap<'a>

O(1). Returns a empty heap.

descending : bool
Returns: BinomialHeap<'a>

BinomialHeap.head xs

Full Usage: BinomialHeap.head xs

Parameters:
Returns: 'T

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

xs : BinomialHeap<'T>
Returns: 'T

BinomialHeap.insert x xs

Full Usage: BinomialHeap.insert x xs

Parameters:
Returns: BinomialHeap<'T>

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

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

BinomialHeap.isDescending xs

Full Usage: BinomialHeap.isDescending xs

Parameters:
Returns: bool

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

xs : BinomialHeap<'T>
Returns: bool

BinomialHeap.isEmpty xs

Full Usage: BinomialHeap.isEmpty xs

Parameters:
Returns: bool

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

xs : BinomialHeap<'T>
Returns: bool

BinomialHeap.length xs

Full Usage: BinomialHeap.length xs

Parameters:
Returns: int

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

xs : BinomialHeap<'T>
Returns: int

BinomialHeap.merge xs ys

Full Usage: BinomialHeap.merge xs ys

Parameters:
Returns: BinomialHeap<'T>

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

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

BinomialHeap.ofSeq descending s

Full Usage: BinomialHeap.ofSeq descending s

Parameters:
    descending : bool
    s : seq<'a>

Returns: BinomialHeap<'a>

O(n * log n). Returns heap from the sequence.

descending : bool
s : seq<'a>
Returns: BinomialHeap<'a>

BinomialHeap.tail xs

Full Usage: BinomialHeap.tail xs

Parameters:
Returns: BinomialHeap<'T>

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

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

BinomialHeap.tryGetHead xs

Full Usage: BinomialHeap.tryGetHead xs

Parameters:
Returns: 'T option

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

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

BinomialHeap.tryGetTail xs

Full Usage: BinomialHeap.tryGetTail xs

Parameters:
Returns: BinomialHeap<'T> option

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

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

BinomialHeap.tryMerge xs ys

Full Usage: BinomialHeap.tryMerge xs ys

Parameters:
Returns: BinomialHeap<'T> option

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

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

BinomialHeap.tryUncons xs

Full Usage: BinomialHeap.tryUncons xs

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

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

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

BinomialHeap.uncons xs

Full Usage: BinomialHeap.uncons xs

Parameters:
Returns: 'T * BinomialHeap<'T>

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

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

Active patterns

Active pattern Description

BinomialHeap.(|Cons|Nil|) h

Full Usage: BinomialHeap.(|Cons|Nil|) h

Parameters:
Returns: Choice<('T * BinomialHeap<'T>), unit>
h : BinomialHeap<'T>
Returns: Choice<('T * BinomialHeap<'T>), unit>