Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple priority queue for Ruby
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION
priority_queue.gemspec

README.rdoc

PriorityQueue

A very simple priority queue.

Usage:

pq = PriorityQueue.new
pq[5]  << 'foo'
pq[10] << 'unimportant foo'
pq[1]  << 'important foo'

pq.shift # => 'important foo'
pq.shift # => 'foo'
pq.shift # => 'unimportant foo'
pq.shift # => nil

PriorityQueue is also enumerable.

Install:

sudo gem install priority-queue -s http://gemcutter.org

License:

Copyright © 2009 Justin Balthrop, Geni.com; Published under The MIT License, see License.txt

Something went wrong with that request. Please try again.