FSharpx.Collections


Deque<'T> Type

Double-ended queue is an ordered linear linear structure implementing the signature of List (head, tail, cons) as well as the mirror-image Vector signature (last, initial, conj). "head" inspects the first or left-most element in the structure, while "last" inspects the last or right-most element. "rev" (reverse) has time complexity O(1). Ordering is by insertion history.

Instance members

Instance member Description

this.Conj(arg1)

Full Usage: this.Conj(arg1)

Parameters:
    arg0 : 'T

Returns: Deque<'T>

O(1). Returns a new deque with the element added to the end.

arg0 : 'T
Returns: Deque<'T>

this.Cons(arg1)

Full Usage: this.Cons(arg1)

Parameters:
    arg0 : 'T

Returns: Deque<'T>

O(1). Returns a new deque with the element added to the beginning.

arg0 : 'T
Returns: Deque<'T>

this.Head

Full Usage: this.Head

Returns: 'T

O(1) amortized, O(n), worst case. Returns the first element.

Returns: 'T

this.Initial

Full Usage: this.Initial

Returns: Deque<'T>

O(1) amortized, O(n), worst case. Returns a new deque of the elements before the last element.

Returns: Deque<'T>

this.IsEmpty

Full Usage: this.IsEmpty

Returns: bool

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

Returns: bool

this.Last

Full Usage: this.Last

Returns: 'T

O(1) amortized, O(n), worst case. Returns the last element.

Returns: 'T

this.Length

Full Usage: this.Length

Returns: int

O(1). Returns the count of elememts.

Returns: int

this.Rev

Full Usage: this.Rev

Returns: Deque<'T>

O(1). Returns deque reversed.

Returns: Deque<'T>

this.Tail

Full Usage: this.Tail

Returns: Deque<'T>

O(1) amortized, O(n), worst case. Returns a new deque of the elements trailing the first element.

Returns: Deque<'T>

this.TryHead

Full Usage: this.TryHead

Returns: 'T option

O(1) amortized, O(n), worst case. Returns option first element.

Returns: 'T option

this.TryInitial

Full Usage: this.TryInitial

Returns: Deque<'T> option

O(1) amortized, O(n), worst case. Returns a new deque of the elements before the last element.

Returns: Deque<'T> option

this.TryLast

Full Usage: this.TryLast

Returns: 'T option

O(1) amortized, O(n), worst case. Returns option last element.

Returns: 'T option

this.TryTail

Full Usage: this.TryTail

Returns: Deque<'T> option

O(1) amortized, O(n), worst case. Returns option deque of the elements trailing the first element.

Returns: Deque<'T> option

this.TryUnconj

Full Usage: this.TryUnconj

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

O(1) amortized, O(n), worst case. Returns option init and the last element.

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

this.TryUncons

Full Usage: this.TryUncons

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

O(1) amortized, O(n), worst case. Returns option first element and tail.

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

this.Unconj

Full Usage: this.Unconj

Returns: Deque<'T> * 'T

O(1) amortized, O(n), worst case. Returns init and the last element.

Returns: Deque<'T> * 'T

this.Uncons

Full Usage: this.Uncons

Returns: 'T * Deque<'T>

O(1) amortized, O(n), worst case. Returns the first element and tail.

Returns: 'T * Deque<'T>