Similar questions 4 more →
Heaps & Priority Queues

Answer & solution
Official answer: B
A binary max-heap must have complete-tree shape as well as parent≥child values. B is complete and satisfies 10≥8, 6; 8≥4, 5; 6≥1, 2. A satisfies value order but not completeness. C has child8 greater than parent5; D also violates value order. Thus B.
Completeness requires every level except possibly the last to be full and the last level to be filled from left to right. In A, node 8 lacks a right child while positions to its right are occupied, and a deeper node exists despite that gap. In B every displayed level is full, and every parent dominates its two children. C fails at 5→8; D fails already at 5→8 and also at 2→4 and 8→10. Checking only the root maximum is insufficient.