fsprojects/FSharpx.Collections


BinomialHeap<'T>

Namespace: FSharpx.Collections.Experimental

Constructors

ConstructorDescription
new(isDescending, heap)
Signature: (isDescending:bool * heap:BinomialTree<'T> list) -> BinomialHeap<'T>

CompiledName: .ctor

Instance members

Instance memberDescription
Head()
Signature: unit -> 'T

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

Insert(x)
Signature: x:'T -> BinomialHeap<'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: unit -> int

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

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

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

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

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

TryGetHead()
Signature: unit -> 'T option

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

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

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

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

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

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

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

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

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

Fork me on GitHub