Let ๐ be the set of all integers from 1 to 15. Consider any order ofโฆ
2026
Let ๐ be the set of all integers from 1 to 15. Consider any order of insertion of the elements of ๐ into a binary search tree that creates a complete binary tree.
Which one of the following elements can NEVER be the third element that is inserted?
- A.
4
- B.
2
- C.
10
- D.
5
Attempted by 40 students.
Show answer & explanation
Correct answer: D
To form a complete BST using numbers 1 to 15,
the final BST must be perfectly balanced.
Hence:
Root = 8
Its immediate children must be:
Left child = 4
Right child = 12
Now analyze insertion order.
1st inserted element:
Must be 8 (root)
2nd inserted element:
Must be either 4 or 12
3rd inserted element:
Must become the other child of root.
Therefore, the third inserted element can only be:
4 or 12
--------------------------------------------------
Checking Options
--------------------------------------------------
Option 1: 4
Possible as third insertion.
Option 2: 2
Possible if:
8, 4, 2
This can still later form a complete BST.
Option 3: 10
Possible if:
8, 12, 10
Option 4: 5
Impossible as third insertion.
Reason:
If 5 is inserted before 4 exists,
then 5 becomes direct left child of 8,
which violates the required complete BST structure.
Hence, 5 can NEVER be the third inserted element.
--------------------------------------------------
Final Answer
--------------------------------------------------
5
"""