A heap is a complete binary tree with special property that value of child nodes is either less or greater than their parent. Two types of Heaps are:
1. Max Heap: where value of parent node is greater than its child nodes (by default)
2. Min Heap: where value of parent node is less than its child nodes
In the given question, all cases are of max heap.
A is NOT valid heap as, 8>4 is there
C is NOT valid heap as, 7>1 is there
D is NOT valid heap as, 7>1 and 8>4 is there
Therefore, B is a valid heap.