RandomAccessList is an ordered linear structure implementing the List signature (head, tail, cons), as well as inspection (lookup) and update (returning a new immutable instance) of any element in the structure by index. Length is O(1). Indexed lookup or update (returning a new immutable instance of RandomAccessList) of any element is O(log32n), which is close enough to O(1) as to make no practical difference: a RandomAccessList containing 4 billion items can lookup or update any item in at most 7 steps. Ordering is by insertion history. While PersistentVector<'T> is appending to the end this version prepends elements to the list.
Instance member | Description |
|
|
Full Usage:
this.Head
Returns: 'T
|
O(1). Returns the first element in the random access list. If the random access list is empty it throws an exception.
|
Full Usage:
this.IsEmpty
Returns: bool
|
|
Full Usage:
this.[arg1]
Parameters:
int
Returns: 'T
|
|
Full Usage:
this.Length
Returns: int
|
|
|
|
|
O(1) for all practical purposes; really O(log32n). Returns a new random access list without the first item. If the collection is empty it throws an exception.
|
Full Usage:
this.TryHead
Returns: 'T option
|
|
|
O(1) for all practical purposes; really O(log32n). Returns option random access list without the first item.
|
|
O(1) for all practical purposes; really O(log32n). Returns option tuple first element and random access list without first item
|
Full Usage:
this.TryUpdate(arg1, arg2)
Parameters:
int
arg1 : 'T
Returns: RandomAccessList<'T> option
|
O(1) for all practical purposes; really O(log32n). Returns option random access list that contains the given value at the index.
|
|
O(1) for all practical purposes; really O(log32n). Returns tuple first element and random access list without first item
|
|
O(1) for all practical purposes; really O(log32n). Returns a new random access list that contains the given value at the index.
|