Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Direction: A binary search tree is constructe... Start Learning for Free
Direction: A binary search tree is constructed by inserting the following numbers in order.
60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34
The number of nodes in the left subtree is:
    Correct answer is '7'. Can you explain this answer?
    Most Upvoted Answer
    Direction: A binary search tree is constructed by inserting the follow...
    Solution:

    To find the number of nodes in the left subtree, we need to first construct the binary search tree using the given numbers.

    Steps to construct the binary search tree:

    1. Start with the first number 60 as the root of the tree.
    2. Insert 25 as the left child of 60.
    3. Insert 72 as the right child of 60.
    4. Insert 15 as the left child of 25.
    5. Insert 30 as the right child of 25.
    6. Insert 68 as the left child of 72.
    7. Insert 101 as the right child of 72.
    8. Insert 13 as the left child of 15.
    9. Insert 18 as the right child of 15.
    10. Insert 47 as the right child of 30.
    11. Insert 70 as the right child of 68.
    12. Insert 34 as the left child of 30.

    The binary search tree would look like this:

    ```
    60
    / \
    25 72
    / \ \
    15 30 101
    / \ \
    13 18 47
    \
    34
    ```

    To find the number of nodes in the left subtree, we need to count the number of nodes that are on the left side of the root node (60).

    Nodes in the left subtree:

    1. Root of the left subtree: 25
    2. Left child of 25: 15
    3. Left child of 15: 13
    4. Right child of 15: 18
    5. Right child of 25: 30
    6. Right child of 30: 47
    7. Left child of 47: 34

    Therefore, the number of nodes in the left subtree is 7.

    Answer: 7.
    Free Test
    Community Answer
    Direction: A binary search tree is constructed by inserting the follow...
    Given, numbers to be inserted are:
    60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34
    Algorithm for the construction of a binary tree:
    If root is NULL
    then create root node
    return
    If root exists then
    compare the data with node.data
    while until insertion position is located
     If data is greater than node
    data goto right subtree
    else
    goto left subtree
    end while
    insert data
    end if
    According to the given numbers and the algorithm, we construct a binary tree i.e.,
    So, the number of nodes in the left subtree is 7 i.e., 13, 15, 18, 25, 30, 34, 47.
    Hence, the correct answer is 7.
    Explore Courses for Computer Science Engineering (CSE) exam

    Top Courses for Computer Science Engineering (CSE)

    Direction: A binary search tree is constructed by inserting the following numbers in order.60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34The number of nodes in the left subtree is:Correct answer is '7'. Can you explain this answer?
    Question Description
    Direction: A binary search tree is constructed by inserting the following numbers in order.60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34The number of nodes in the left subtree is:Correct answer is '7'. 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 Direction: A binary search tree is constructed by inserting the following numbers in order.60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34The number of nodes in the left subtree is:Correct answer is '7'. 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 Direction: A binary search tree is constructed by inserting the following numbers in order.60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34The number of nodes in the left subtree is:Correct answer is '7'. Can you explain this answer?.
    Solutions for Direction: A binary search tree is constructed by inserting the following numbers in order.60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34The number of nodes in the left subtree is:Correct answer is '7'. 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 Direction: A binary search tree is constructed by inserting the following numbers in order.60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34The number of nodes in the left subtree is:Correct answer is '7'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Direction: A binary search tree is constructed by inserting the following numbers in order.60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34The number of nodes in the left subtree is:Correct answer is '7'. Can you explain this answer?, a detailed solution for Direction: A binary search tree is constructed by inserting the following numbers in order.60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34The number of nodes in the left subtree is:Correct answer is '7'. Can you explain this answer? has been provided alongside types of Direction: A binary search tree is constructed by inserting the following numbers in order.60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34The number of nodes in the left subtree is:Correct answer is '7'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Direction: A binary search tree is constructed by inserting the following numbers in order.60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34The number of nodes in the left subtree is:Correct answer is '7'. 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