¶
luxe
API (2025.1.2
)¶
luxe: pqueue
module¶
MaxPQ¶
import "luxe: pqueue" for MaxPQ
A 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
peek
or values removed viapop
the values are sorted.
unknown
Returns the internal array. Read only, modify the queue via
add
andpop
.
unknown
Returns the number of items in the priority queue.
MaxPQ
Create a new priority queue.
Any
)
¶MaxPQ
Create 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.
Any
)
¶unknown
Add a value to the queue.
unknown
Return the next value, removing it from the queue.
unknown
Return the next value without removing it from the queue.
MinPQ¶
import "luxe: pqueue" for MinPQ
A 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
peek
or values removed viapop
the values are sorted.
unknown
Returns the internal array. Read only, modify the queue via
add
andpop
.
unknown
Returns the number of items in the priority queue.
MinPQ
Create a new priority queue.
Any
)
¶MinPQ
Create 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.
Any
)
¶unknown
Add a value to the queue.
unknown
Return the next value, removing it from the queue.
unknown
Return the next value without removing it from the queue.