Question discussion

In a binary heap stored in an array whose root is at index 1, the parent of the node at index 11 is located at index

2134Medium DSSSB TGT Computer Science 0 replies 1 views
0

In a binary heap stored in an array whose root is at index 1, the parent of the node at index 11 is located at index

  • A5
  • B4
  • C6
  • D10
Correct answer: A

Explanation

The parent of the node at index i is at floor(i / 2); floor(11 / 2) = 5.

Discussion 0

Nobody has replied yet. Start the discussion!