FSharpx.Collections


SkewBinomialHeap Module

Functions and values

Function or value Description

SkewBinomialHeap.count xs

Full Usage: SkewBinomialHeap.count xs

Parameters:
Returns: int

O(1) - Returns the number of elements in the collection.

xs : 'T SkewBinomialHeap
Returns: int

SkewBinomialHeap.empty descending

Full Usage: SkewBinomialHeap.empty descending

Parameters:
    descending : bool

Returns: 'a SkewBinomialHeap

O(1) - Returns an empty heap.

descending : bool
Returns: 'a SkewBinomialHeap

SkewBinomialHeap.head xs

Full Usage: SkewBinomialHeap.head xs

Parameters:
Returns: 'T

O(log n) - Returns the element at the front. Throws if empty.

xs : 'T SkewBinomialHeap
Returns: 'T

SkewBinomialHeap.insert x xs

Full Usage: SkewBinomialHeap.insert x xs

Parameters:
Returns: 'T SkewBinomialHeap

O(1) - Returns a new heap with the element inserted.

x : 'T
xs : 'T SkewBinomialHeap
Returns: 'T SkewBinomialHeap

SkewBinomialHeap.isDescending xs

Full Usage: SkewBinomialHeap.isDescending xs

Parameters:
Returns: bool

O(1) - Returns true if a call to head of tryHead would return the maximum element in the collection. Returns false if the element at the head is the minimum.

xs : 'T SkewBinomialHeap
Returns: bool

SkewBinomialHeap.isEmpty xs

Full Usage: SkewBinomialHeap.isEmpty xs

Parameters:
Returns: bool

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

xs : 'T SkewBinomialHeap
Returns: bool

SkewBinomialHeap.length xs

Full Usage: SkewBinomialHeap.length xs

Parameters:
Returns: int

O(1) - Returns the number of elements in the collection.

xs : 'T SkewBinomialHeap
Returns: int

SkewBinomialHeap.merge xs ys

Full Usage: SkewBinomialHeap.merge xs ys

Parameters:
Returns: 'T SkewBinomialHeap

O(log n) - Returns a new heap with the elements of both heaps. The two heaps must have the same isDescending value.

xs : 'T SkewBinomialHeap
ys : 'T SkewBinomialHeap
Returns: 'T SkewBinomialHeap

SkewBinomialHeap.ofSeq descending s

Full Usage: SkewBinomialHeap.ofSeq descending s

Parameters:
    descending : bool
    s : seq<'a>

Returns: 'a SkewBinomialHeap

O(n) - Returns heap from the sequence.

descending : bool
s : seq<'a>
Returns: 'a SkewBinomialHeap

SkewBinomialHeap.tail xs

Full Usage: SkewBinomialHeap.tail xs

Parameters:
Returns: 'T SkewBinomialHeap

O(log n) - Returns a new heap with the front (head) element removed. Throws if empty.

xs : 'T SkewBinomialHeap
Returns: 'T SkewBinomialHeap

SkewBinomialHeap.toList xs

Full Usage: SkewBinomialHeap.toList xs

Parameters:
Returns: 'T list

O(n * log n) - Returns and ordered list of the elements in the heap.

xs : 'T SkewBinomialHeap
Returns: 'T list

SkewBinomialHeap.toSeq xs

Full Usage: SkewBinomialHeap.toSeq xs

Parameters:
Returns: IEnumerable<'T>

O(n * log n) - Returns and ordered sequence of the elements in the heap.

xs : 'T SkewBinomialHeap
Returns: IEnumerable<'T>

SkewBinomialHeap.tryHead xs

Full Usage: SkewBinomialHeap.tryHead xs

Parameters:
Returns: 'T option

O(log n) - Returns Some x where x is the element at the front. Returns None if the collection is empty.

xs : 'T SkewBinomialHeap
Returns: 'T option

SkewBinomialHeap.tryMerge xs ys

Full Usage: SkewBinomialHeap.tryMerge xs ys

Parameters:
Returns: 'T SkewBinomialHeap option

O(log n) - Returns Some h where h is the merged heap, is both original heaps have the same isDescending value. Returns None if isDescending is different in the heaps supplied.

xs : 'T SkewBinomialHeap
ys : 'T SkewBinomialHeap
Returns: 'T SkewBinomialHeap option

SkewBinomialHeap.tryTail xs

Full Usage: SkewBinomialHeap.tryTail xs

Parameters:
Returns: 'T SkewBinomialHeap option

O(log n) - Returns Some h where h is the heap with the front (head) element removed. Returns None if the collection is empty.

xs : 'T SkewBinomialHeap
Returns: 'T SkewBinomialHeap option

SkewBinomialHeap.tryUncons xs

Full Usage: SkewBinomialHeap.tryUncons xs

Parameters:
Returns: ('T * 'T SkewBinomialHeap) option

O(log n) - Returns Some (h, t) where h is the head and t is the tail. Returns None if the collection is empty.

xs : 'T SkewBinomialHeap
Returns: ('T * 'T SkewBinomialHeap) option

SkewBinomialHeap.uncons xs

Full Usage: SkewBinomialHeap.uncons xs

Parameters:
Returns: 'T * 'T SkewBinomialHeap

O(log n) - Returns the head element and tail. Throws if empty.

xs : 'T SkewBinomialHeap
Returns: 'T * 'T SkewBinomialHeap

Active patterns

Active pattern Description

SkewBinomialHeap.(|Cons|Nil|) heap

Full Usage: SkewBinomialHeap.(|Cons|Nil|) heap

Parameters:
Returns: Choice<('T * 'T SkewBinomialHeap), unit>
heap : 'T SkewBinomialHeap
Returns: Choice<('T * 'T SkewBinomialHeap), unit>