Vidyalelo
Data Structure · Q39

Heaps

Programming · Data Structure · question 39

Q39

In a binary heap stored as an array, what is the index of the parent node for the node at index i?

A.
(i - 1) / 2
Answer
B.
(i + 1) / 2
C.
(i + 2) / 2
D.
(i - 2) / 2

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board