fsprojects/FSharpx.Collections


LeftistHeap<'T>

Namespace: FSharpx.Collections.Experimental

Union Cases

Union CaseDescription
E(bool)
Signature: bool
T(...)
Signature: bool * int * int * 'T * LeftistHeap<'T> * LeftistHeap<'T>

Instance members

Instance memberDescription
Head
Signature: 'T

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

CompiledName: get_Head

Insert(x)
Signature: x:'T -> LeftistHeap<'T>

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

IsDescending
Signature: bool

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

CompiledName: get_IsDescending

IsEmpty
Signature: bool

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

CompiledName: get_IsEmpty

Length
Signature: int

O(1). Returns the count of elememts.

CompiledName: get_Length

Merge(xs)
Signature: xs:LeftistHeap<'T> -> LeftistHeap<'T>

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

Tail()
Signature: unit -> LeftistHeap<'T>

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

TryGetHead
Signature: 'T option

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

CompiledName: get_TryGetHead

TryGetTail()
Signature: unit -> LeftistHeap<'T> option

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

TryMerge(xs)
Signature: xs:LeftistHeap<'T> -> LeftistHeap<'T> option

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

TryUncons()
Signature: unit -> ('T * LeftistHeap<'T>) option

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

Uncons()
Signature: unit -> 'T * LeftistHeap<'T>

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

Fork me on GitHub