class IntervalTree::Tree

def center(intervals)

using a start point as resresentative value of the node
augmented tree
def center(intervals)
  i = intervals.reduce([intervals.first.first, intervals.first.last]) { |acc, int| [[acc.first, int.first].min, [acc.last, int.last].max] }
  i.first + (i.last - i.first) / 2
end