How many different binary trees and binary search trees can
be made from three nodes that contain the key values 1, 2 & 3?
Answer Posted / sreekumar
Nubmerof Nodes| BT Possible | BST Possible|
==============+================+==============
1 | 1 | 1
--------------+----------------+---------------
2 | 2 | 2
--------------+----------------+---------------
3 | 6 | 5
--------------+----------------+---------------
4 | 24 | 14
--------------+----------------+--------------
. | . | .
--------------+----------------+--------------
| |
| | 2n 1
| | C * ------
n | n! | n (n+1)
------------------------------------------------------
C=Combinations
n!,2nCn /(n+1)
Is This Answer Correct ? | 57 Yes | 35 No |
Post New Answer View All Answers
Which sorting is stable?
Is vector a collection?
Is it necessary to sort a file before searching a particular item ?
What is stack explain with diagram?
What is the difference between arrays sort and collections sort?
What is hash data type?
Is array size dynamic or fixed?
What is meant by strongly connected in a graph?
List some applications of queue data structure.
What is the use of data structure in real life?
What is map entry?
What does bubble sort do?
How many types of data structure are there?
What happens if we put duplicate key in hashmap?
What method is used to place a value onto the top of a stack?