FSharpx.Collections


Queue<'T>

Namespace: FSharpx.Collections
Attributes:
[<Class>]

Queue is an ordered linear data structure where elements are added at the end (right) and inspected and removed at the beginning (left). Ordering is by insertion history. The qualities of the Queue structure make elements first in, first out (fifo). "head" inspects the first or left-most element in the structure, while "conj" inserts an element at the end, or right of the structure. Purely functional (immutable) Queue based on Okasaki's batched queue.

Instance members

Instance memberDescription
x.Conj(arg1)
Signature: 'T -> Queue<'T>

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

x.Head
Signature: 'T

O(1). Returns the first element. (Peek)

CompiledName: get_Head

x.IsEmpty
Signature: bool

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

CompiledName: get_IsEmpty

x.Length
Signature: int

O(1). Returns the count of elememts.

CompiledName: get_Length

x.Rev()
Signature: unit -> Queue<'T>

O(n). Returns queue reversed.

x.Tail
Signature: Queue<'T>

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

CompiledName: get_Tail

x.TryHead
Signature: 'T option

O(1). Returns option first element

CompiledName: get_TryHead

x.TryTail
Signature: Queue<'T> option

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

CompiledName: get_TryTail

x.TryUncons
Signature: ('T * Queue<'T>) option

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

CompiledName: get_TryUncons

x.Uncons
Signature: 'T * Queue<'T>

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

CompiledName: get_Uncons

Fork me on GitHub