fsprojects/FSharpx.Collections


LeftistHeap

Namespace: FSharpx.Collections.Experimental

Functions and values

Function or valueDescription
empty descending
Signature: descending:bool -> LeftistHeap<'?12952>
Type parameters: '?12952

O(1). Returns a empty heap.

head xs
Signature: xs:LeftistHeap<'T> -> 'T
Type parameters: 'T

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

insert x xs
Signature: x:'T -> xs:LeftistHeap<'T> -> LeftistHeap<'T>
Type parameters: 'T

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

isDescending xs
Signature: xs:LeftistHeap<'T> -> bool
Type parameters: 'T

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

isEmpty xs
Signature: xs:LeftistHeap<'T> -> bool
Type parameters: 'T

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

length xs
Signature: xs:LeftistHeap<'T> -> int
Type parameters: 'T

O(1). Returns the count of elememts.

merge xs ys
Signature: xs:LeftistHeap<'T> -> ys:LeftistHeap<'T> -> LeftistHeap<'T>
Type parameters: 'T

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

ofSeq descending s
Signature: descending:bool -> s:seq<'?12970> -> LeftistHeap<'?12970>
Type parameters: '?12970

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

tail xs
Signature: xs:LeftistHeap<'T> -> LeftistHeap<'T>
Type parameters: 'T

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

tryGetHead xs
Signature: xs:LeftistHeap<'T> -> 'T option
Type parameters: 'T

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

tryGetTail xs
Signature: xs:LeftistHeap<'T> -> LeftistHeap<'T> option
Type parameters: 'T

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

tryMerge xs ys
Signature: xs:LeftistHeap<'T> -> ys:LeftistHeap<'T> -> LeftistHeap<'T> option
Type parameters: 'T

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

tryUncons xs
Signature: xs:LeftistHeap<'T> -> ('T * LeftistHeap<'T>) option
Type parameters: 'T

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

uncons xs
Signature: xs:LeftistHeap<'T> -> 'T * LeftistHeap<'T>
Type parameters: 'T

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

Active patterns

Active patternDescription
( |Cons|Nil| ) h
Signature: h:LeftistHeap<'T> -> Choice<('T * LeftistHeap<'T>),unit>
Type parameters: 'T

CompiledName: |Cons|Nil|

Fork me on GitHub