Algorithms of sorting, graphs, trees written in Ruby