edited by
8,334 views
5 5 votes

Consider the following binary search tree T given below: Which node contains the fourth smallest element in T?

  1. Q
  2. V
  3. W
  4. X

5 Answers

Best answer
19 19 votes

Inorder traversal of BST sorts the elements in ascending order .

UQXWPVZY --> inorder traversal

4th smallest element is W.

selected by
7 7 votes

The In-order traversal of BST gives number in sorted order

Here In-order traversal sequence is as follows

U Q X W P V Z Y

hence 4rth smallest will be W

Hence Option C) W will be the answer. 

4 4 votes

Answer C) W

In BST left child is smaller than root value and right child is greater than root value.

1 1 vote
In these type of question,find INORDER traversal. INORDER TRAVERSAL is arranged in ascending order so in this question 4th element from starting of inorder traversal,i.e., W is 4th smallest element
Answer:
Position:
Show:

Related questions

7 7 votes
7 answers 7 answers
19.8k
19.8k views
go_editor asked Jul 1, 2016
19,756 views
Consider a single linked list where $F$ and $L$ are pointers to the first and last elements respectively of the linked list. The time for performing which of the given op...
12 12 votes
9 answers 9 answers
23.7k
23.7k views
ajit asked Sep 23, 2015
23,740 views
How many different trees are there with four nodes $\text{A, B, C}$ and $\text{D}?$$30$$60$$90$$120$
5 5 votes
5 5 answers
14.0k
14.0k views
ajit asked Sep 23, 2015
14,020 views
Consider a standard Circular Queue implementation (which has the same condition for Queue Full and Queue Empty) whose size is $11$ and the elements of the queue are $q[0]...
6 6 votes
2 answers 2 answers
12.2k
12.2k views
go_editor asked Jun 10, 2016
12,176 views
The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two ...