Vidyalelo
Data Structure · Q8

Heaps

Programming · Data Structure · question 8

Q8

In a binary heap, how is the parent node index calculated from a child node index i?

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

Answer: Option A

Solution

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