implement heap sort in Ruby