Data Structures and Algorithms in ruby