ACtE07 · Chapter 7Data Structures, DBMS & Operating Systems🏛️ Past Licensure QuestionID: fc96aafe
Which array represents a min-heap (1-based index; parent ≤ children)?
Which array represents a min-heap (1-based index; parent ≤ children)?
Multiple Choice Options
- A
[2, 1, 3, 4]
- B✓ Correct Option
[1, 3, 2, 4]
- C
[3, 1, 2, 4]
- D
[2, 3, 4, 1]
Detailed Technical Solution & Explanation
In a 1-based binary min-heap array , the min-heap property requires that every node's value must be less than or equal to the values of its children:
Evaluating Option B :
•
For (): Left child ; Right child . (Satisfied)
•
For (): Left child . (Satisfied)
Thus, strictly satisfies the min-heap property.
Option Analysis:
•
Option A ([2, 1, 3, 4]): Incorrect. Root is greater than its left child ( is false).
•
Option B ([1, 3, 2, 4]): Correct. Every parent node is smaller than or equal to its child nodes across all indices.
•
Option C ([3, 1, 2, 4]): Incorrect. Root is greater than its children and .
•
Option D ([2, 3, 4, 1]): Incorrect. Node is greater than its left child .
Reference: Demo2 · Set 1NEC Licensure Syllabus