Storing a heap using an array