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
Does linked list allow null values?
Program to remove duplicate elements in an array.
What are the advantages of linked list?
What do you mean by 2-3-4 tree?
Tell me what should be done in the base case for this recursive problem?
If we try to add duplicate key to the hashmap, what will happen?
Why is arraylist used?
Explain binary tree traversals?
What is a bubble sort and how do you perform it?
Can you declare an array without assigning the size of an array?
what is the primary advantage of a linked list?
What do you mean by linear probing?
Can map contain duplicate keys?
Explain what are the major data structures used in the network data model?
Give one example of right rotation.