luxe: pqueue
import "luxe: pqueue" for MaxPQA priority queue that returns larger values first.
A priority queue holds various values and will sort them into an ordered list by priority. When queried via
peekor values removed viapopthe values are sorted.
MaxPQ.value
Section titled “MaxPQ.value”MaxPQ.value : unknownReturns the internal array. Read only, modify the queue via
addandpop.
MaxPQ.count
Section titled “MaxPQ.count”MaxPQ.count : unknownReturns the number of items in the priority queue.
MaxPQ.new(.)
Section titled “MaxPQ.new(.)”MaxPQ.new() : MaxPQCreate a new priority queue.
MaxPQ.new(.)
Section titled “MaxPQ.new(.)”MaxPQ.new(get_priority_fn : Any) : MaxPQCreate a new priority queue with a callback for the priority of a value. The callback takes one parameter, the value, and should return a priority number for that value.
MaxPQ.add(.)
Section titled “MaxPQ.add(.)”MaxPQ.add(value : Any) : unknownAdd a value to the queue.
MaxPQ.pop(.)
Section titled “MaxPQ.pop(.)”MaxPQ.pop() : unknownReturn the next value, removing it from the queue.
MaxPQ.peek(.)
Section titled “MaxPQ.peek(.)”MaxPQ.peek() : unknownReturn the next value without removing it from the queue.
import "luxe: pqueue" for MinPQA priority queue that returns smaller values first.
A priority queue holds various values and will sort them into an ordered list by priority. When queried via
peekor values removed viapopthe values are sorted.
MinPQ.value
Section titled “MinPQ.value”MinPQ.value : unknownReturns the internal array. Read only, modify the queue via
addandpop.
MinPQ.count
Section titled “MinPQ.count”MinPQ.count : unknownReturns the number of items in the priority queue.
MinPQ.new(.)
Section titled “MinPQ.new(.)”MinPQ.new() : MinPQCreate a new priority queue.
MinPQ.new(.)
Section titled “MinPQ.new(.)”MinPQ.new(get_priority_fn : Any) : MinPQCreate a new priority queue with a callback for the priority of a value. The callback takes one parameter, the value, and should return a priority number for that value.
MinPQ.add(.)
Section titled “MinPQ.add(.)”MinPQ.add(value : Any) : unknownAdd a value to the queue.
MinPQ.pop(.)
Section titled “MinPQ.pop(.)”MinPQ.pop() : unknownReturn the next value, removing it from the queue.
MinPQ.peek(.)
Section titled “MinPQ.peek(.)”MinPQ.peek() : unknownReturn the next value without removing it from the queue.