FSharpx.Collections


LeftistHeap Module

Functions and values

Function or value Description

LeftistHeap.empty descending

Full Usage: LeftistHeap.empty descending

Parameters:
    descending : bool

Returns: LeftistHeap<'a>

O(1). Returns a empty heap.

descending : bool
Returns: LeftistHeap<'a>

LeftistHeap.head xs

Full Usage: LeftistHeap.head xs

Parameters:
Returns: 'T

O(1). Returns the min or max element.

xs : LeftistHeap<'T>
Returns: 'T

LeftistHeap.insert x xs

Full Usage: LeftistHeap.insert x xs

Parameters:
Returns: LeftistHeap<'T>

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

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

LeftistHeap.isDescending xs

Full Usage: LeftistHeap.isDescending xs

Parameters:
Returns: bool

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

xs : LeftistHeap<'T>
Returns: bool

LeftistHeap.isEmpty xs

Full Usage: LeftistHeap.isEmpty xs

Parameters:
Returns: bool

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

xs : LeftistHeap<'T>
Returns: bool

LeftistHeap.length xs

Full Usage: LeftistHeap.length xs

Parameters:
Returns: int

O(1). Returns the count of elements.

xs : LeftistHeap<'T>
Returns: int

LeftistHeap.merge xs ys

Full Usage: LeftistHeap.merge xs ys

Parameters:
Returns: LeftistHeap<'T>

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

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

LeftistHeap.ofSeq descending s

Full Usage: LeftistHeap.ofSeq descending s

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

Returns: LeftistHeap<'a>

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

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

LeftistHeap.tail xs

Full Usage: LeftistHeap.tail xs

Parameters:
Returns: LeftistHeap<'T>

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

xs : LeftistHeap<'T>
Returns: LeftistHeap<'T>

LeftistHeap.tryGetHead xs

Full Usage: LeftistHeap.tryGetHead xs

Parameters:
Returns: 'T option

O(1). Returns option first min or max element.

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

LeftistHeap.tryGetTail xs

Full Usage: LeftistHeap.tryGetTail xs

Parameters:
Returns: LeftistHeap<'T> option

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

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

LeftistHeap.tryMerge xs ys

Full Usage: LeftistHeap.tryMerge xs ys

Parameters:
Returns: LeftistHeap<'T> option

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

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

LeftistHeap.tryUncons xs

Full Usage: LeftistHeap.tryUncons xs

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

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

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

LeftistHeap.uncons xs

Full Usage: LeftistHeap.uncons xs

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

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

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

Active patterns

Active pattern Description

LeftistHeap.(|Cons|Nil|) h

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

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