Module
Data.PriorityQueue
- Package
- purescript-priority-queue
- Repository
- spacchetti/purescript-priority-queue
#Queue Source
newtype Queue a
A priority queue that allows for efficient insertion and removal of elements. The queue can be created with a custom ordering function that determines the priority of elements. Note: it's not possible to have a meaninful Eq instance, as two queues with the same elements might have them in different order due to the heap structure. It's recommended to convert the queue to an array to compare it.
#newMaxQueue Source
newMaxQueue :: forall a. (a -> Number) -> Effect (Queue a)
Create a new priority queue where the element with the largest value according to the provided function will be at the front of the queue.
#newMinQueue Source
newMinQueue :: forall a. (a -> Number) -> Effect (Queue a)
Create a new priority queue where the element with the smallest value according to the provided function will be at the front of the queue.
- Modules
- Data.
PriorityQueue