priorityq
A priority queue implementation based on max pairing heaps. Written in pure Gleam.
Installation
Add priorityq
to your Gleam project
gleam add priorityq
Usage
import gleam/int
import priorityq
pub fn main() {
priorityq.new(int.compare) |> priorityq.is_empty // -> True
let pq = priorityq.from_list([1, 5], int.compare)
pq |> priorityq.push(10) |> priorityq.peek // -> 10
pq |> priorityq.pop |> priorityq.size // -> 1
}
Further documentation can be found at https://hexdocs.pm/priorityq.
Development
gleam test # Run the tests