Heap.PQ (Heap v0.1.0) View Source
A proirity queue implemetation.
The priority of each elements can be customized when enqueue
.
Link to this section Summary
Functions
Dequeue and pick the smallest priority item.
Returns an empty priority queue.
Returns whether the queue is empty.
Enqueue an item into queue with optional priority. If priority is not set, the item itself is considered as the priority.
Link to this section Functions
Dequeue and pick the smallest priority item.
If everything is ok, it returns {:ok, new_queue, picked_item}, otherwise it returns {:error, reason}
Returns an empty priority queue.
Returns whether the queue is empty.
Enqueue an item into queue with optional priority. If priority is not set, the item itself is considered as the priority.
Returns a new queue with item enqueued.