FSharpx.Collections


BatchedDeque<'T> Type

Constructors

Constructor Description

BatchedDeque(front, rBack)

Full Usage: BatchedDeque(front, rBack)

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

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

Instance members

Instance member Description

this.Cons(x)

Full Usage: this.Cons(x)

Parameters:
    x : 'T

Returns: BatchedDeque<'T>

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

x : 'T
Returns: BatchedDeque<'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: BatchedDeque<'T>

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

Returns: BatchedDeque<'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: BatchedDeque<'T>

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

i : int
Returns: BatchedDeque<'T>

this.Rev

Full Usage: this.Rev

Returns: BatchedDeque<'T>

O(1). Returns deque reversed.

Returns: BatchedDeque<'T>

this.Snoc(x)

Full Usage: this.Snoc(x)

Parameters:
    x : 'T

Returns: BatchedDeque<'T>

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

x : 'T
Returns: BatchedDeque<'T>

this.Tail

Full Usage: this.Tail

Returns: BatchedDeque<'T>

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

Returns: BatchedDeque<'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: BatchedDeque<'T> option

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

Returns: BatchedDeque<'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: BatchedDeque<'T> option

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

Returns: BatchedDeque<'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: BatchedDeque<'T> option

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

i : int
Returns: BatchedDeque<'T> option

this.TryUncons

Full Usage: this.TryUncons

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

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

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

this.TryUnsnoc

Full Usage: this.TryUnsnoc

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

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

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

this.TryUpdate(i) (y)

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

Parameters:
    i : int
    y : 'T

Returns: BatchedDeque<'T> option

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

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

this.Uncons

Full Usage: this.Uncons

Returns: 'T * BatchedDeque<'T>

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

Returns: 'T * BatchedDeque<'T>

this.Unsnoc

Full Usage: this.Unsnoc

Returns: BatchedDeque<'T> * 'T

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

Returns: BatchedDeque<'T> * 'T

this.Update(i) (y)

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

Parameters:
    i : int
    y : 'T

Returns: BatchedDeque<'T>

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

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