Sorting algorithms implemented in ruby