Skip to content

A priority queue implementation based on max pairing heaps. Written in pure Gleam.

License

Notifications You must be signed in to change notification settings

nicklimmm/priorityq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

priorityq

Package Version Hex Docs

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

About

A priority queue implementation based on max pairing heaps. Written in pure Gleam.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages