Computer Science EngineeringModerate

In a max-heap, the largest element is always located at

  1. A. a leaf node
  2. B. the leftmost leaf
  3. C. the middle of the array
  4. D. the root

Correct answer: D. the root

The max-heap property makes every parent at least as large as its children, so the root is the maximum.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic