FSharpx.Collections


LeftistHeap<'T> Type

Union cases

Union case Description

E bool

Full Usage: E bool

Parameters:
    Item : bool

Item : bool

T(bool, int, int, 'T, LeftistHeap<'T>, LeftistHeap<'T>)

Full Usage: T(bool, int, int, 'T, LeftistHeap<'T>, LeftistHeap<'T>)

Parameters:
Item1 : bool
Item2 : int
Item3 : int
Item4 : 'T
Item5 : LeftistHeap<'T>
Item6 : LeftistHeap<'T>

Instance members

Instance member Description

this.Head

Full Usage: this.Head

Returns: 'T

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

Returns: 'T

this.Insert(x)

Full Usage: this.Insert(x)

Parameters:
    x : 'T

Returns: LeftistHeap<'T>

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

x : 'T
Returns: LeftistHeap<'T>

this.IsDescending

Full Usage: this.IsDescending

Returns: bool

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

Returns: bool

this.IsEmpty

Full Usage: this.IsEmpty

Returns: bool

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

Returns: bool

this.Length

Full Usage: this.Length

Returns: int

O(1). Returns the count of elements.

Returns: int

this.Merge(xs)

Full Usage: this.Merge(xs)

Parameters:
Returns: LeftistHeap<'T>

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

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

this.Tail()

Full Usage: this.Tail()

Returns: LeftistHeap<'T>

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

Returns: LeftistHeap<'T>

this.TryGetHead

Full Usage: this.TryGetHead

Returns: 'T option

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

Returns: 'T option

this.TryGetTail()

Full Usage: this.TryGetTail()

Returns: LeftistHeap<'T> option

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

Returns: LeftistHeap<'T> option

this.TryMerge(xs)

Full Usage: this.TryMerge(xs)

Parameters:
Returns: LeftistHeap<'T> option

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

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

this.TryUncons()

Full Usage: this.TryUncons()

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

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

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

this.Uncons()

Full Usage: this.Uncons()

Returns: 'T * LeftistHeap<'T>

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

Returns: 'T * LeftistHeap<'T>