0.0
No commit activity in last 3 years
No release in over 3 years
A simple priority queue in Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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