Alogorithms by Robert Sedgewink in Ruby