Implementation of Heap structures in Ruby