Ruby implementation of algorithms from sedgewick book