keen/col/priority-queue
Sourcepriority-queue[k, v] record (has private fields)size[k, v] nat64(a (k, v) priority-queue) k priorityNumber of pairs in the priority queue. This is O(n) where n is the result.
~[k, v] (k, v) priority-queue(a (k, v) priority-queue, b (k, v)) k priorityAdds a pair to the queue. This is O(1), since the work of sorting pairs is actually done in
pop.
Immutable priority queue.
Elements are key-value pairs. Pairs are sorted by key. Popping removes the pair with the lowest key.
If two pairs have the same key, the second pair added will be popped second.