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 best?
What is a static structure?
What is the difference between data type and data structure?
What are the types of bulleted list?
How can someone display singly linked list from first to last?
Which are the sorted collections?
Which is the parent class of abstractqueue class?
Which is the parent class of enumset class?
What is the limit of arraylist?
How can we remove loops in a linked list? What are the functions of fast and slow pointers?
Should I use hashmap or hashtable?
What is hashing technique? Describe in brief.
Is vector synchronized?
What is collision in data structure?
Does treemap preserve order?