algorithms.rb

lib/algorithms.rb
Last Update: Fri Apr 03 23:35:12 -0400 2009

The ‘Algorithms and Containers’ library is an effort to provide a set of commonly used algorithms and containers to Ruby programmers.

This is a Google Summer of Code 2008 project

Written by Kanwei Li, mentored by Austin Ziegler

To avoid typing Containers::xxx to initialize containers, include the Containers module.

require 'algorithms'
include Containers

tree = RBTreeMap.new

instead of:

require 'algorithms'

tree = Containers::RBTreeMap.new

Done so far:

Required files

  1. CBst
  2. algorithms/search
  3. algorithms/sort
  4. containers/heap
  5. containers/stack
  6. containers/deque
  7. containers/queue
  8. containers/priority_queue
  9. containers/rb_tree_map
  10. containers/splay_tree_map
  11. containers/suffix_array
  12. containers/trie
  13. containers/kd_tree

Constants

Bst = Containers::CBst