Which one of the following elements can NEVER be the third element that is inserted?
Correct : d
A complete BST with 15 nodes (1 to 15) has a unique structure — root = 8, level-1 nodes = 4 and 12, level-2 nodes = 2, 6, 10, 14, and the 8 leaves at level 3.
The root must always be 8 (inserted first). For the 2nd insertion, only 4 or 12 are valid since they go directly as children of 8 and match the required structure. For the 3rd insertion, the valid choices depend on what was inserted 2nd.
If 8 → 4 → ?, then the 3rd element can be 12 (right child of 8) or 2 (left child of 4). Both keep the structure buildable toward the complete BST.
If 8 → 12 → ?, then the 3rd element can be 4 (left child of 8) or 14 (right child of 12) or 10 (left child of 12).
Now checking option D — inserting 5 as the 3rd element. The only way 5 can be 3rd is after 8 and 4 are inserted. In BST, 5 > 4 so 5 becomes the right child of 4. But in the required complete BST, the right child of 4 must be 6, not 5. With 5 already placed as right child of 4, inserting 6 later would make 6 the right child of 5 (since 6 > 5), not the parent of 5. This permanently breaks the complete BST structure — 6 can never occupy its required position as the right child of 4. So 5 can never be the 3rd element in any valid insertion order that produces the complete BST.
Options A (4), B (2), and C (10) are all achievable as the 3rd element through valid insertion sequences as shown above.
Correct answer: D — 5 can NEVER be the 3rd element ✓
Similar Questions
Total Unique Visitors