Consider an array representation of an n element binary heap where the elements are stored from index 1 to index n of the array. For the element stored at index i of the array (i < = n), the index of the parent is:
1
floor ((i + 1) / 2)
2
ceiling ((i + 1) / 2
3
floor (i / 2)
4
ceiling (i / 2)