Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Simple priority Queue implementation for NodeJS (Javascript)
branch: master

This branch is 25 commits behind augustohp:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
tests
README.textile
package.json

README.textile

Priority Queue (NodeJS)

It’s a simple implementation of a PriorityQueue for NodeJS. As the code is JavaScript it could be used on the browser without any trouble.

The basic usage is to push() elements and give them a priority to be used into the queue. You can also set a custom compare() function and a limit of elements to be held into the queue.

More examples can be found into the tests folder.


queue = new PriorityQueue();
queue.push(“Most important note”, 99);
queue.push(“Important note”, 50);
queue.push(“Silly notice”, 1);

x = queue.top(); // Most important note
x = queue.top(); // Important note
x = queue.top(); // Silly notice
x = queue.top(); // undefined

Something went wrong with that request. Please try again.