Data Structures & AlgorithmsEasyHCL · Tech Mahindra pattern

In a min-heap, where is the smallest element always found?

  1. A. At the leftmost leaf
  2. B. At the last leaf
  3. C. Anywhere among the leaves
  4. D. At the root

Correct answer: D. At the root

The heap property makes every parent ≤ its children, so the minimum is at the root (index 0 of the array). The leaves hold larger values, and the maximum is somewhere among them.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic