FSharpx.Collections


BankersDeque<'T> Type

Constructors

Constructor Description

BankersDeque(c, frontLength, front, rBackLength, rBack)

Full Usage: BankersDeque(c, frontLength, front, rBackLength, rBack)

Parameters:
    c : int
    frontLength : int
    front : LazyList<'T>
    rBackLength : int
    rBack : LazyList<'T>

Returns: BankersDeque<'T>
c : int
frontLength : int
front : LazyList<'T>
rBackLength : int
rBack : LazyList<'T>
Returns: BankersDeque<'T>

Instance members

Instance member Description

this.Cons(x)

Full Usage: this.Cons(x)

Parameters:
    x : 'T

Returns: BankersDeque<'T>

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

x : 'T
Returns: BankersDeque<'T>

this.Head

Full Usage: this.Head

Returns: 'T

O(1), amortized. Returns the first element.

Returns: 'T

this.Init

Full Usage: this.Init

Returns: BankersDeque<'T>

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

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

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

i : int
Returns: BankersDeque<'T>

this.Rev

Full Usage: this.Rev

Returns: BankersDeque<'T>

O(1). Returns deque reversed.

Returns: BankersDeque<'T>

this.Snoc(x)

Full Usage: this.Snoc(x)

Parameters:
    x : 'T

Returns: BankersDeque<'T>

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

x : 'T
Returns: BankersDeque<'T>

this.Tail

Full Usage: this.Tail

Returns: BankersDeque<'T>

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

Returns: BankersDeque<'T>

this.TryGetHead

Full Usage: this.TryGetHead

Returns: 'T option

O(1), amortized. Returns option first element.

Returns: 'T option

this.TryGetInit

Full Usage: this.TryGetInit

Returns: BankersDeque<'T> option

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

Returns: BankersDeque<'T> option

this.TryGetLast

Full Usage: this.TryGetLast

Returns: 'T option

O(1), amortized. Returns option last element.

Returns: 'T option

this.TryGetTail

Full Usage: this.TryGetTail

Returns: BankersDeque<'T> option

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

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

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

i : int
Returns: BankersDeque<'T> option

this.TryUncons

Full Usage: this.TryUncons

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

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

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

this.TryUnsnoc

Full Usage: this.TryUnsnoc

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

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

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

this.TryUpdate(i) (y)

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

Parameters:
    i : int
    y : 'T

Returns: BankersDeque<'T> option

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

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

this.Uncons

Full Usage: this.Uncons

Returns: 'T * BankersDeque<'T>

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

Returns: 'T * BankersDeque<'T>

this.Unsnoc

Full Usage: this.Unsnoc

Returns: BankersDeque<'T> * 'T

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

Returns: BankersDeque<'T> * 'T

this.Update(i) (y)

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

Parameters:
    i : int
    y : 'T

Returns: BankersDeque<'T>

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

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