array implementation of a heap