Stability | experimental |
---|---|
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Safe Haskell | Safe-Inferred |
Tested with: GHC 7.6.3
An imperative heap-based priority queue.
- data PriorityQueue a
- queueNull :: PriorityQueue a -> IO Bool
- queueCount :: PriorityQueue a -> IO Int
- newQueue :: IO (PriorityQueue a)
- enqueue :: PriorityQueue a -> Double -> a -> IO ()
- dequeue :: PriorityQueue a -> IO ()
- queueFront :: PriorityQueue a -> IO (Double, a)
Documentation
data PriorityQueue a Source
The PriorityQueue
type represents an imperative heap-based
priority queue.
queueNull :: PriorityQueue a -> IO BoolSource
Test whether the priority queue is empty.
queueCount :: PriorityQueue a -> IO IntSource
Return the number of elements in the priority queue.
newQueue :: IO (PriorityQueue a)Source
Create a new priority queue.
enqueue :: PriorityQueue a -> Double -> a -> IO ()Source
Enqueue a new element with the specified priority.
dequeue :: PriorityQueue a -> IO ()Source
Dequeue the element with the minimal priority.
queueFront :: PriorityQueue a -> IO (Double, a)Source
Return the element with the minimal priority.