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

Related Questions

Consider the following system of equations in three real variables x1, x2 and x3
2x1 - x2 + 3x3 = 1
3x1 - 2x2 + 5x3 = 2
-x1 - 4x2 + x3 = 3
This system of equations has
Let X1, X2 be two independent normal random variables with means μ1, μ2 and standard deviations σ1, σ2 respectively. Consider Y = X1 - X2; μ1 = μ2 = 1, σ1 = 1, σ2 = 2, Then,