edited by
30,459 views
26 votes
26 votes

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

  1. $(4, 7)$
  2. $(7, 4)$
  3. $(8, 3)$
  4. $(3, 8)$
edited by

5 Answers

Best answer
38 votes
38 votes
Correct Option: B

Root will be $50$. now insert one by one, greater to $50$ in the right sub tree, lesser in left sub tree.

Or you can simply count the number looking at the i/p. less than $50$ are $7$. more than $50$ are $4$.
edited by
9 votes
9 votes

Here's how the BST looks like. For GATE, going with the >50 or <50 is preferable.

8 votes
8 votes
50 is root Node in BST

So greater than 50 will be in right subtree of 50 and less than 50 in left subtree

So  ans will be B(7,4)
3 votes
3 votes
Since root will be 50,  just count the number of elements less than or greater than 50.
Answer:

Related questions

54 votes
54 votes
7 answers
1
Kathleen asked Oct 9, 2014
22,712 views
A binary search tree is used to locate the number $43$. Which of the following probe sequences are possible and which are not? Explain.$\begin{array}{llllll} \text{(a)} ...
28 votes
28 votes
3 answers
2
Kathleen asked Oct 9, 2014
13,509 views
The minimum number of interchanges needed to convert the array into a max-heap is$89, 19, 40, 17, 12, 10, 2, 5, 7, 11, 6, 9, 70$$0$$1$$2$$3$
21 votes
21 votes
3 answers
3
Kathleen asked Oct 9, 2014
4,309 views
Which of the following sequences denotes the post order traversal sequence of the below tree?$f\; e\; g\; c\; d\; b\; a$$g\; c\; b\; d\; a\; f\; e$$g\; c\; d\; b\; f\; e\...