package orsetto
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e260412b2dd0f98cfe3dc7ed5c31a694eb31c93cd207c51fa12675b790234ee0ad3bf07d9be17a4dc266fedfe55b14c967cad7bc0c9414063eef8afd59f3d0d1
doc/orsetto.cf/Cf_sbheap/PQueue/Create/index.html
Module PQueue.Create
A functor to create a PQueue module.
Parameters
module K : Cf_relations.OrderSignature
val nil : 'a tThe empty priority queue.
Use one kv to create a priority queue containing the single priority-value pair kv.
val empty : 'a t -> boolUse empty q to test whether q is empty.
val size : 'a t -> intUse size q to compute the number of elements in q. Runs in O(n) time and O(log N) space.
Use head q to obtain the key-value pair on the top of q. Raises Not_found if q is empty.
Use tail q to obtain the priority queue produced by discarding the element at the top of q. If q is the empty queue, then the empty queue is returned.
Use pop q to obtain the head and the tail of a priority queue q in one operation. Returns None if q is empty.
Use put kv q to obtain a new priority queue that is the result of inserting the key-value pair kv into q.
Use merge q1 q2 to obtain a new priority queue that is the result of merging all the elements of q1 and q2 into a single queue.
Use of_seq s to construct a priority queue from a sequence of key-value pairs. Evaluates the whole sequence. Runs in O(n) time and O(1) space.