Heapsort beautifully bridges arrays and trees. It treats a flat array as a Complete Binary Tree without extra memory overhead.
Parent(i) = (i-1)/2
LeftChild(i) = 2i + 1
RightChild(i) = 2i + 2
heapify()