UGC-NET Dec 2018 · Trees

MCQ · 2 marks · Problem PROG-DSTR-0053

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
  1. A
    $5$
  2. B
    $6$
  3. C
    $7$
  4. D
    $3$

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionThe root is 60. Every later key less than 60 goes into the left subtree:\[25,\ 15,\ 30,\ 13,\ 18,\ 47,\ 34.\]Keys 72, 68, 101, 70 go to the right subtree. So the left subtree has 7 nodes.Answer: C

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com