The following is the sequence of insertion in a binary search tree. 45,65,35,40,33,70,60,75,69 How many numbers of nodes in Left Sub Tree (LST) and Right Sub Tree (RST) of Root node.
The following is the sequence of insertion in a binary search tree. 45,65,35,40,33,70,60,75,69 How many numbers of nodes in Left Sub Tree (LST) and Right Sub Tree (RST) of Root node. Correct Answer LST – 3, RST-5
Concept:
In binary search tree
- Left sub tree (LST) of every node should contains only nodes with key value less than the node’s key
- Right sub tree (RST ) of every node should contains only nodes with key values greater or equal than the node’s key
Explanation:
BST tree after inserting all the nodes ( values )
[ alt="F1 R.S 8.5.20 Pallavi d1" src="//storage.googleapis.com/tb-img/production/20/05/F1_R.S_8.5.20_Pallavi_d1.png" style="width: 245px; height: 188px;">
∴ LST = 3 and RST = 5
মোঃ আরিফুল ইসলাম
Feb 20, 2025