Alogorithms by Robert Sedgewink. Implemented in Ruby.