Building a min heap from an array