+1 vote
in Data Structures & Algorithms I by (110k points)
How many randomized binary search trees can be formed by the numbers (1, 3, 2)?

(a) 2

(b) 3

(c) 6

(d) 5

The above asked question is from Binary Trees topic in section Binary Trees of Data Structures & Algorithms I

I have been asked this question in an interview for internship.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
The correct answer is (d) 5

Easy explanation - As there are 3 numbers (1, 3, 2) so total of 6 combinations can be formed using three numbers but Since (2, 1, 3) and (2, 3, 1) are same so in total there are 5 randomized binary search tree that can be formed.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...