Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ne-sachirou/pqueue2
Elixir Priority queue that wraps pqueue2.
https://github.com/ne-sachirou/pqueue2
elixir priority-queue
Last synced: 4 days ago
JSON representation
Elixir Priority queue that wraps pqueue2.
- Host: GitHub
- URL: https://github.com/ne-sachirou/pqueue2
- Owner: ne-sachirou
- License: mit
- Created: 2017-07-02T16:18:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-30T01:58:09.000Z (over 1 year ago)
- Last Synced: 2024-09-19T10:37:55.421Z (about 2 months ago)
- Topics: elixir, priority-queue
- Language: Elixir
- Size: 88.9 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Actions Status](https://github.com/ne-sachirou/pqueue2/workflows/test/badge.svg)](https://github.com/ne-sachirou/pqueue2/actions)
[![Coverage Status](https://coveralls.io/repos/github/ne-sachirou/pqueue2/badge.svg)](https://coveralls.io/github/ne-sachirou/pqueue2)
[![Hex.pm](https://img.shields.io/hexpm/v/pqueue2.svg)](https://hex.pm/packages/pqueue2)# PQueue2
Priority queue that wraps [pqueue2](https://hex.pm/packages/pqueue).
```elixir
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.
```elixir
[: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](https://hexdocs.pm/pqueue2).
## Installation
Add `pqueue2` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:pqueue2, "~> 0.4"}]
end
```