FSharpx.Collections


Deque<'T> Type

Constructors

Constructor Description

Deque(front, rBack)

Full Usage: Deque(front, rBack)

Parameters:
    front : 'T list
    rBack : 'T list

Returns: Deque<'T>
front : 'T list
rBack : 'T list
Returns: Deque<'T>

Instance members

Instance member Description

this.Cons(x)

Full Usage: this.Cons(x)

Parameters:
    x : 'T

Returns: Deque<'T>

O(1) amortized, O(n), worst case. Returns a new deque with the element added to the beginning.

x : '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.Init

Full Usage: this.Init

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 elements.

Returns: int

this.Lookup(i)

Full Usage: this.Lookup(i)

Parameters:
    i : int

Returns: 'T

O(n), worst case. Returns element by index.

i : int
Returns: 'T

this.Remove(i)

Full Usage: this.Remove(i)

Parameters:
    i : int

Returns: Deque<'T>

O(n), worst case. Returns deque with element removed by index.

i : int
Returns: Deque<'T>

this.Rev

Full Usage: this.Rev

Returns: Deque<'T>

O(1). Returns deque reversed.

Returns: Deque<'T>

this.Snoc(x)

Full Usage: this.Snoc(x)

Parameters:
    x : 'T

Returns: Deque<'T>

O(1) amortized, O(n), worst case. Returns a new deque with the element added to the end.

x : 'T
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.TryGetHead

Full Usage: this.TryGetHead

Returns: 'T option

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

Returns: 'T option

this.TryGetInit

Full Usage: this.TryGetInit

Returns: Deque<'T> option

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

Returns: Deque<'T> option

this.TryGetLast

Full Usage: this.TryGetLast

Returns: 'T option

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

Returns: 'T option

this.TryGetTail

Full Usage: this.TryGetTail

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.TryLookup(i)

Full Usage: this.TryLookup(i)

Parameters:
    i : int

Returns: 'T option

O(n), worst case. Returns option element by index.

i : int
Returns: 'T option

this.TryRemove(i)

Full Usage: this.TryRemove(i)

Parameters:
    i : int

Returns: Deque<'T> option

O(n), worst case. Returns option deque with element removed by index.

i : int
Returns: Deque<'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.TryUnsnoc

Full Usage: this.TryUnsnoc

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.TryUpdate(i) (y)

Full Usage: this.TryUpdate(i) (y)

Parameters:
    i : int
    y : 'T

Returns: Deque<'T> option

O(n), worst case. Returns option deque with element updated by index.

i : int
y : 'T
Returns: Deque<'T> option

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>

this.Unsnoc

Full Usage: this.Unsnoc

Returns: Deque<'T> * 'T

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

Returns: Deque<'T> * 'T

this.Update(i) (y)

Full Usage: this.Update(i) (y)

Parameters:
    i : int
    y : 'T

Returns: Deque<'T>

O(n), worst case. Returns deque with element updated by index.

i : int
y : 'T
Returns: Deque<'T>