Computer Science, asked by luvkumar9050, 8 months ago

Construct a BST with node values 100,50,150,75,125,74,76,124,130,73,131 and find the left sub-tree Min value.

Answers

Answered by divyanshtiwarivk
11

Answer:

i will give your answer but before this you follow me

Explanation:

Answered by ankhidassarma9
0

Answer:

give values :    100,50,150,75,125,74,76,124,130,73,131                          

                                         Binary Search Tree

                                                        100

                                                      /         \

                                                   50         150

                                                    \              /

                                                   75         125

                                                   /   \        /     \

                                                 74  76  124  130

                                                  /                      \

                                               73                     131

The left sub-tree Min value is 50

Explanation:

  • A tree is a  data structure that is used to represent the data in hierarchical form.
  • In a Binary search tree(BTS), the value of left node always smaller than it's parent node, and the value of right node always greater than it's parent node. Same rule is applied recursively to the left and right subtrees of the Root.
  • In the Constructed BTS, we can observe that the Root node is 100, and all the nodes of the left subtree are smaller than the Root node, and all the nodes of the right subtree are greater than the Root node 100.
  • In the same way, we can see the left child of Root node is greater than its left child and smaller than its right child. So, it  satisfies the property of binary search tree. Hence,  the tree in the above image is a binary search tree.
  • To find the left sub-tree Min value, we have to Just traverse the node from root to left recursively until left is NULL. The node whose left is a NULL, is the node with minimum value. For the above tree, we have to start with the Root 100, then we move left 50. Since left of 50 is NULL, so, 50 is the node with minimum value.
Similar questions