This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
README | Sat Jun 06 20:46:31 -0700 2009 | |
| |
example.html | Sat Jun 06 20:46:31 -0700 2009 | |
| |
src/ | Sat Jun 06 20:46:31 -0700 2009 | |
| |
test.html | Sat Jun 06 20:46:31 -0700 2009 | |
| |
test/ | Sat Jun 06 20:56:44 -0700 2009 |
README
== Description ==
Ever need a simple priority queue? I sure as hell did. JavaScript doesn't make sharing code easy, so I'm going the extra
mile to bring you this: PriorityQueue.js.
== Features ==
* Simple to use and understand.
* Creates a single PriorityQueue constructor.
* Instantiate via `PriorityQueue();` or `new PriorityQueue();`
* Offers both highest first and lowest first ordering.
* Test suite included.
The default is highest priority first, but when doing something like A* you want lowest priority first... it handles it:
`queue = PriorityQueue({low: true});` Boom!
== Example Usage ==
// Highest priority first
var queue = PriorityQueue();
queue.push("b", 5);
queue.push("a", 10);
queue.pop(); // => "a"
queue.pop(); // => "b"
// Lowest priority first
var queue = PriorityQueue({low: true});
queue.push("x", 5);
queue.push("y", 10);
queue.pop(); // => "x"
queue.pop(); // => "y"
== License ==
MIT






