Module OgamlUtils.PriorityQueue.Q

Type of PriorityQueue.Make

This module provides a basic implementation of priority queues

exception Empty
Raised when a queue is empty
type priority
Priorities used by the queue
type 'a t
Type of a queue storing elements of type 'a
val empty : 'a t
Empty queue
val is_empty : 'a t -> bool
Returns true iff the queue is empty
val singleton : priority -> 'a -> 'a t
Singleton queue
val merge : 'a t -> 'a t -> 'a t
Merges two queues
val insert : 'a t -> priority -> 'a -> 'a t
Inserts an element with a given priority
val top : 'a t -> 'a
Returns the top element of a queue
Raises Empty if the queue is empty
val pop : 'a t -> 'a t
Removes the top element of a queue
Raises Empty if the queue is empty
val extract : 'a t -> ('a * 'a t)
Returns the top element of a queue and the queue without its first element
Raises Empty if the queue is empty