InPlace.PriorityQueue (inplace v0.7.1)

Copy Markdown

Summary

Functions

Creates a priority queue. Currently backed by binary heap. The priorities are {term(), number()} tuples, where the 2nd element defines the priority on the 1st element. Options: :comparator - the boolean function that compares 2 priorities (default is Kernel.</2) :keep_lesser - insert/2,3 will ignore new priority for the key if it's not strictly less (as decided by comparator) than the current one (default is true)

Functions

empty?(p_queue)

extract_min(p_queue)

get_mapping(p_queue, key)

get_min(p_queue)

get_priority(p_queue, key)

insert(p_queue, arg)

insert(p_queue, key, priority)

new(capacity, opts \\ [])

Creates a priority queue. Currently backed by binary heap. The priorities are {term(), number()} tuples, where the 2nd element defines the priority on the 1st element. Options: :comparator - the boolean function that compares 2 priorities (default is Kernel.</2) :keep_lesser - insert/2,3 will ignore new priority for the key if it's not strictly less (as decided by comparator) than the current one (default is true)

size(p_queue)

valid?(p_queue)