FSharpx.Collections


BootstrappedQueue Module

bootstrapped queue from Chris Okasaki's "Purely functional data structures" original implementation taken from http://lepensemoi.free.fr/index.php/2010/02/18/bootstrapped-queue

Functions and values

Function or value Description

BootstrappedQueue.empty

Full Usage: BootstrappedQueue.empty

Returns: BootstrappedQueue<'a>

O(1). Returns queue of no elements.

Returns: BootstrappedQueue<'a>

BootstrappedQueue.head queue

Full Usage: BootstrappedQueue.head queue

Parameters:
Returns: 'T

O(1), worst case. Returns the first element.

queue : BootstrappedQueue<'T>
Returns: 'T

BootstrappedQueue.isEmpty _arg1

Full Usage: BootstrappedQueue.isEmpty _arg1

Parameters:
Returns: bool

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

_arg1 : BootstrappedQueue<'a>
Returns: bool

BootstrappedQueue.length queue

Full Usage: BootstrappedQueue.length queue

Parameters:
Returns: int

O(1). Returns the count of elements.

queue : BootstrappedQueue<'T>
Returns: int

BootstrappedQueue.ofList list

Full Usage: BootstrappedQueue.ofList list

Parameters:
Returns: BootstrappedQueue<'T>

O(1). Returns a queue of the list.

list : List<'T>
Returns: BootstrappedQueue<'T>

BootstrappedQueue.snoc x queue

Full Usage: BootstrappedQueue.snoc x queue

Parameters:
Returns: BootstrappedQueue<'a>

O(log* n). Returns a new queue with the element added to the end.

x : 'a
queue : BootstrappedQueue<'a>
Returns: BootstrappedQueue<'a>

BootstrappedQueue.tail queue

Full Usage: BootstrappedQueue.tail queue

Parameters:
Returns: BootstrappedQueue<'T>

O(log* n), worst case. Returns a new queue of the elements trailing the first element.

queue : BootstrappedQueue<'T>
Returns: BootstrappedQueue<'T>

BootstrappedQueue.tryGetHead queue

Full Usage: BootstrappedQueue.tryGetHead queue

Parameters:
Returns: 'T option

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

queue : BootstrappedQueue<'T>
Returns: 'T option

BootstrappedQueue.tryGetTail queue

Full Usage: BootstrappedQueue.tryGetTail queue

Parameters:
Returns: BootstrappedQueue<'T> option

O(log* n), worst case. Returns option queue of the elements trailing the first element.

queue : BootstrappedQueue<'T>
Returns: BootstrappedQueue<'T> option