Discussion
For a given max-heap, which is the correct answer ?
Answer: B
In a max-heap, the leaf nodes have values less than or equal to their parents.
The max-heap property says that every node's key is greater than or equal to the keys of its children. Applied to a leaf and its parent, the leaf's value can be no larger than its parent's. As a result the maximum is at the root.
Option A states the min-heap property instead. C and D are not required: a leaf may equal its parent or differ from it, as long as it is not larger.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development