(insert-into elements element)
Inserts an element into the elements buffer.
Inserts an element into the elements buffer.
(remove-from elements)
Removes an element from the elements buffer.
Removes an element from the elements buffer.
(priority-for priority-queue element)
Returns the priority of the element if it were to be inserted into the priority queue.
Returns the priority of the element if it were to be inserted into the priority queue.
(priority-queue element->priority
&
{:keys [elements priority-comparator variant]
:or {priority-comparator (fn* [p1__1881# p2__1880#]
(compare p2__1880# p1__1881#))
variant :queue}})
Factory function to create a priority queue populated by elements. The element->priority is invoked on an element to compute the priority. The priority-comparator (defaults to larger values having higher priority) is used to order priorities. The variant (defaults to :queue) is used to determine how to break ties for equal priority elements. Valid values for variant are :queue (FIFO ordering) and :set (random tie-breaking).
Factory function to create a priority queue populated by elements. The element->priority is invoked on an element to compute the priority. The priority-comparator (defaults to larger values having higher priority) is used to order priorities. The variant (defaults to :queue) is used to determine how to break ties for equal priority elements. Valid values for variant are :queue (FIFO ordering) and :set (random tie-breaking).
(priority-queue->available-priorities priority-queue)
Returns a sorted vector of available priorities in the queue.
Returns a sorted vector of available priorities in the queue.
(priority-queue->element->priority priority-queue)
Returns the function used to compute the priority of elements in the priority queue.
Returns the function used to compute the priority of elements in the priority queue.
(priority-queue->top-priority priority-queue)
Returns the highest priority of the available elements in the priority queue.
Returns the highest priority of the available elements in the priority queue.
(priority-queue? reference)
Returns true if the reference passed in is an instance of a priority queue.
Returns true if the reference passed in is an instance of a priority queue.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close