The following is the insertion sequence for a Binary Search Tree (BST): 45,…
2020
The following is the insertion sequence for a Binary Search Tree (BST):
45, 65, 35, 40, 33, 70, 60, 75, 69
How many nodes are present in the Left Sub Tree (LST) and Right Sub Tree (RST) of the root node?
- A.
LST – 6, RST – 2
- B.
LST – 5, RST – 3
- C.
LST – 3, RST – 5
- D.
LST – 2, RST – 6
Attempted by 365 students.
Show answer & explanation
Correct answer: C
In a Binary Search Tree, the first inserted element becomes the root. Here the root is 45.
LST (elements < 45): 35, 40, 33 -> 3 nodes
RST (elements > 45): 65, 70, 60, 75, 69 -> 5 nodes
Thus, LST = 3 and RST = 5. The correct option is C.