DotNetLightning


Heap<'T> Type

Heap is an ordered linear structure where the ordering is ascending or descending. "head" inspects the first element in the ordering, "tail" takes the remaining structure after head, and "insert" places elements within the ordering. PriorityQueue is available as an alternate interface. According to Okasaki the time complexity of the heap functions in this Heap implementation (based on the "pairing" heap) have resisted time complexity analysis.

Constructors

Constructor Description

Heap(isDescending, length, data)

Full Usage: Heap(isDescending, length, data)

Parameters:
    isDescending : bool
    length : int
    data : HeapData<'T>

Returns: Heap<'T>
isDescending : bool
length : int
data : HeapData<'T>
Returns: Heap<'T>

Instance members

Instance member Description

this.Head

Full Usage: this.Head

Returns: 'T
Returns: 'T

this.Insert

Full Usage: this.Insert

Parameters:
    x : 'T

Returns: Heap<'T>
x : 'T
Returns: Heap<'T>

this.IsDescending

Full Usage: this.IsDescending

Returns: bool
Returns: bool

this.IsEmpty

Full Usage: this.IsEmpty

Returns: bool
Returns: bool

this.Length

Full Usage: this.Length

Returns: int
Returns: int

this.Merge

Full Usage: this.Merge

Parameters:
Returns: Heap<'T>
xs : Heap<'T>
Returns: Heap<'T>

this.Rev

Full Usage: this.Rev

Returns: Heap<'T>
Returns: Heap<'T>

this.Tail

Full Usage: this.Tail

Returns: Heap<'T>
Returns: Heap<'T>

this.TryHead

Full Usage: this.TryHead

Returns: 'T option
Returns: 'T option

this.TryMerge

Full Usage: this.TryMerge

Parameters:
Returns: Heap<'T> option
xs : Heap<'T>
Returns: Heap<'T> option

this.TryTail

Full Usage: this.TryTail

Returns: Heap<'T> option
Returns: Heap<'T> option

this.TryUncons

Full Usage: this.TryUncons

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

this.Uncons

Full Usage: this.Uncons

Returns: 'T * Heap<'T>
Returns: 'T * Heap<'T>

Static members

Static member Description

Heap.ofSeq isDescending s

Full Usage: Heap.ofSeq isDescending s

Parameters:
    isDescending : bool
    s : seq<'T>

Returns: Heap<'T>
isDescending : bool
s : seq<'T>
Returns: Heap<'T>