Elixir Priority queue that wraps pqueue2.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
lib
test
.credo.exs
.formatter.exs
.gitignore
.travis.yml
LICENSE
README.md
mix.exs
mix.lock

README.md

PQueue2

Priority queue that wraps pqueue2.

Hex.pm Build Status

q = PQueue2.new |> PQueue2.put(:a, 2) |> PQueue2.put(:b, 1) |> PQueue2.put(:c, 1)
{:b, q} = PQueue2.pop(q)
{:c, q} = PQueue2.pop(q)
{:a, q} = PQueue2.pop(q)

PQueue2 implements Collectable & Enumerable.

[:b, :c, :a, :d] == [{:a, 2}, {:b, 1}, {:c, 1}, {:d, 2}] |> Enum.into(PQueue2.new) |> Enum.to_list()

For more details please read the Doc.

Installation

Add pqueue2 to your list of dependencies in mix.exs:

def deps do
  [{:pqueue2, "~> 0.3"}]
end