A binary min-heap contains distinct elements. The maximum element can be stored at most in _____________ different positions in the underlying array.
10
Step-by-Step Solution
Key idea: In a min-heap, the maximum element must be at a leaf node. The number of leaves in a complete binary tree with nodes is .
Step 1: Identify that in a min-heap, the maximum cannot be at an internal node (it would violate the heap property since children must be parent).
Step 2: Therefore, the maximum must be at a leaf.
Step 3: Count the leaves: .
Answer: 10
Common trap: Using gives the same answer for even , but for odd it would be wrong. Always use for leaf count.