# updatable-priority-queue

> A priority queue implementation based on a binary heap, with an efficient update-key operation

Latest version **0.0.1** (published 2016-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install updatable-priority-queue
pnpm add updatable-priority-queue
yarn add updatable-priority-queue
bun add updatable-priority-queue
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-04-25 |
| First published | 2016-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Benjamin Becquet |
| Maintainers | bbecquet |
| Keywords | priority, queue, queue, binary, heap, heap |

## Links

- npm: https://www.npmjs.com/package/updatable-priority-queue
- Repository: https://github.com/bbecquet/updatable-priority-queue
- Homepage: https://github.com/bbecquet/updatable-priority-queue#readme
- Issues: https://github.com/bbecquet/updatable-priority-queue/issues
- npm.io page: https://npm.io/package/updatable-priority-queue

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2016-04-25

## README

updatable-priority-queue
===

A generic priority queue implementation based on a binary heap, with an efficient `updateKey` operation.

It was made first to support the pathfinding algorithms of my [jKstra](https://github.com/bbecquet/jKstra) graph library, but it can probably serves other purposes.

```bash
$> npm install updatable-priority-queue
```

API
---

Property | Type | Description
---|---|---
count | `Integer` | Number of items stored in the queue.

Method | Returns | Description
---|---|---
`insert(item, key)`| `Vertex` | Adds an item to the queue, with a key used as sorting value.
`pop()` | `{item, key}` | Removes and returns the first item of the queue, with its associated key, or `null` if the queue is empty.
`peek()` | `{item, key}` | Reads the first item of the queue, with its associated key, without removing it, or `null` if the queue is empty.
`updateKey(item, newKey)` | - | Updates the key associated with an element.

---
_Source: https://npm.io/package/updatable-priority-queue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
