NIMCET 2021 Computer PYQ — The given numbers are inserted into an empty binary search tree i… | Mathem Solvex | Mathem Solvex
Tip:A–D to answerE for explanationV for videoS to reveal answer
NIMCET 2021 — Computer PYQ
NIMCET | Computer | 2021
The given numbers are inserted into an empty binary search tree in the given order: 10,1,3,5,15,12 and 16. What is the height of the binary search tree.
Choose the correct answer:
A.
3
(Correct Answer)
B.
4
C.
5
D.
6
Correct Answer:
3
Explanation
BST Structure
Level 0:10 (Root)
Level 1:1,15
Level 2:3,12,16
Level 3:5
Height Calculation
The height is the number of edges on the longest path from the root (10) to the deepest leaf (5).
Longest Path: 10→1→3→5
Number of Edges=3
Final Equation
Height(BST)=max(Level of 5,Level of 12,Level of 16)
Height=3
Explanation
BST Structure
Level 0:10 (Root)
Level 1:1,15
Level 2:3,12,16
Level 3:5
Height Calculation
The height is the number of edges on the longest path from the root (10) to the deepest leaf (5).
Longest Path: 10→1→3→5
Number of Edges=3
Final Equation
Height(BST)=max(Level of 5,Level of 12,Level of 16)