Correct option is B
A min-heap is a complete binary tree in which the key at every parent node is less than or equal to the keys of its children. The given heap contains 10 elements, so the newly inserted key 32 is first placed at the next available position to preserve the complete binary tree property.
This position is the left child of node 40. Since 32 < 40, the min-heap property is violated, so 32 is exchanged with 40. After the exchange, 32 becomes the child of node 10, and since 32 > 10, no further upward adjustment is required.
Therefore, the resulting heap is exactly Option (b).
Information Booster
1. Initial heap in level-order: 5, 10, 25, 30, 40, 50, 60, 70, 80, 90
2. Insertion position of 32
· A heap must always remain a complete binary tree.
· Therefore, 32 is initially inserted at the 11th position in level-order.
· Its parent is the node 40.
3. Heapify-up operation
· Since 32 < 40, the newly inserted element violates the min-heap property.
· Interchange 32 and 40.
· The relevant portion becomes:
10 → 32 → 40
4. Final check
· The parent of 32 is now 10.
· Since, 10 < 32 the min-heap property is satisfied.
· Hence, no further swapping is necessary.
5. Final level-order representation:
5, 10, 25, 30, 32, 50, 60, 70, 80, 90, 40
Additional Knowledge
· Option (a) is incorrect: It places 32 as a child of 40 without performing the required upward adjustment. Since 32 < 40, that configuration violates the min-heap property.
· Option (c) is incorrect: Its structure does not represent the correct result of inserting 32 into the given complete binary tree. In particular, the positions of several existing elements are changed unnecessarily.
· Important point: During insertion into a min-heap, the new element is always placed at the next available leaf position first, followed by heapify-up (sift-up) until the heap property is restored.
· For a heap containing n elements, insertion takes O(log n) time in the worst case because the newly inserted element can move upward by at most the height of the heap.



