Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  A binary search tree is generated by insertin... Start Learning for Free
A binary search tree is generated by inserting in order the following integers:
50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24
​The number of nodes in the left subtree and right subtree of the root respectively is
  • a)
    (4,7)
  • b)
    (7,4)
  • c)
    (8, 3)
  • d)
    (3,8)
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
A binary search tree is generated by inserting in order the following ...
View all questions of this test
Most Upvoted Answer
A binary search tree is generated by inserting in order the following ...
Explanation:

To determine the number of nodes in the left and right subtrees of the root, we need to construct the binary search tree (BST) using the given integers and count the number of nodes in each subtree.

Constructing the BST:
We start by inserting the first integer, 50, as the root of the BST. Then, we insert the remaining integers one by one according to the rules of a binary search tree:

- 15 is less than 50, so it becomes the left child of the root.
- 62 is greater than 50, so it becomes the right child of the root.
- 5 is less than 50 and less than 15, so it becomes the left child of 15.
- 20 is greater than 15 and less than 50, so it becomes the right child of 15.
- 58 is greater than 50 and less than 62, so it becomes the left child of 62.
- 91 is greater than 50 and greater than 62, so it becomes the right child of 62.
- 3 is less than 50, less than 15, and less than 5, so it becomes the left child of 5.
- 8 is greater than 5 and less than 15, so it becomes the right child of 5.
- 37 is greater than 15 and less than 50, so it becomes the right child of 20.
- 60 is greater than 50, greater than 58, and less than 62, so it becomes the right child of 58.
- 24 is greater than 15, less than 50, and less than 37, so it becomes the left child of 37.

Counting the nodes:
To determine the number of nodes in the left and right subtrees of the root, we count the nodes in each subtree.

- Left subtree of the root (15, 5, 3, 8): 4 nodes
- Right subtree of the root (62, 58, 91, 20, 37, 60, 24): 7 nodes

Therefore, the correct answer is option 'B' (7 nodes in the right subtree and 4 nodes in the left subtree).
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

A binary search tree is generated by inserting in order the following integers:50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24​The number of nodes in the left subtree and right subtree of the root respectively isa)(4,7)b)(7,4)c)(8, 3)d)(3,8)Correct answer is option 'B'. Can you explain this answer?
Question Description
A binary search tree is generated by inserting in order the following integers:50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24​The number of nodes in the left subtree and right subtree of the root respectively isa)(4,7)b)(7,4)c)(8, 3)d)(3,8)Correct answer is option 'B'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about A binary search tree is generated by inserting in order the following integers:50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24​The number of nodes in the left subtree and right subtree of the root respectively isa)(4,7)b)(7,4)c)(8, 3)d)(3,8)Correct answer is option 'B'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for A binary search tree is generated by inserting in order the following integers:50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24​The number of nodes in the left subtree and right subtree of the root respectively isa)(4,7)b)(7,4)c)(8, 3)d)(3,8)Correct answer is option 'B'. Can you explain this answer?.
Solutions for A binary search tree is generated by inserting in order the following integers:50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24​The number of nodes in the left subtree and right subtree of the root respectively isa)(4,7)b)(7,4)c)(8, 3)d)(3,8)Correct answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of A binary search tree is generated by inserting in order the following integers:50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24​The number of nodes in the left subtree and right subtree of the root respectively isa)(4,7)b)(7,4)c)(8, 3)d)(3,8)Correct answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of A binary search tree is generated by inserting in order the following integers:50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24​The number of nodes in the left subtree and right subtree of the root respectively isa)(4,7)b)(7,4)c)(8, 3)d)(3,8)Correct answer is option 'B'. Can you explain this answer?, a detailed solution for A binary search tree is generated by inserting in order the following integers:50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24​The number of nodes in the left subtree and right subtree of the root respectively isa)(4,7)b)(7,4)c)(8, 3)d)(3,8)Correct answer is option 'B'. Can you explain this answer? has been provided alongside types of A binary search tree is generated by inserting in order the following integers:50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24​The number of nodes in the left subtree and right subtree of the root respectively isa)(4,7)b)(7,4)c)(8, 3)d)(3,8)Correct answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice A binary search tree is generated by inserting in order the following integers:50, 15, 62, 5, 20,58, 91, 3, 8, 37, 60, 24​The number of nodes in the left subtree and right subtree of the root respectively isa)(4,7)b)(7,4)c)(8, 3)d)(3,8)Correct answer is option 'B'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev