Ruby heapsort