Heaps & Priority Queues

Your answer
Answer & solution
Answer: B for nonroot nodes (no official key was published)
Step 1: A node at index j has left child 2j and right child 2j+1. For an even child index i=2j, division gives i/2=j. For an odd child i=2j+1, floor(i/2)=j.
Step 2: Both cases are captured by floor(i/2), B. For example indices 6 and 7 both have parent 3; ceiling would incorrectly map 7 to 4.
Boundary: The root at i=1 has no parent. The formula returns sentinel index 0, outside the heap, rather than describing a genuine parent.