fsprojects/FSharpx.Collections


PriorityQueue

Namespace: FSharpx.Collections

Functions and values

Function or valueDescription
empty isDescending
Signature: isDescending:bool -> IPriorityQueue<'T>
Type parameters: 'T

O(1). Returns a empty queue, with indicated ordering.

insert element pq
Signature: element:'T -> pq:IPriorityQueue<'T> -> IPriorityQueue<'T>
Type parameters: 'T

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

isEmpty pq
Signature: pq:IPriorityQueue<'T> -> bool
Type parameters: 'T

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

peek pq
Signature: pq:IPriorityQueue<'T> -> 'T
Type parameters: 'T

O(1). Returns the first element.

pop pq
Signature: pq:IPriorityQueue<'T> -> 'T * IPriorityQueue<'T>
Type parameters: 'T

O(log n) amortized time. Returns the first element and tail.

tryPeek pq
Signature: pq:IPriorityQueue<'T> -> 'T option
Type parameters: 'T

O(1). Returns option first element.

tryPop pq
Signature: pq:IPriorityQueue<'T> -> ('T * IPriorityQueue<'T>) option
Type parameters: 'T

O(log n) amortized time. Returns the option first element and tail.

Fork me on GitHub