Sorting algorithms implemented in Ruby