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
What is a circular singly linked list?
Tell me why can't constant values be used to define an array's initial size
Calculate the address of a random element present in a 2d array, given base address as ba.
What are the 3 types of measurement?
What is meant by strongly connected in a graph?
Which sorting is best in time complexity?
State the demerit of linear representation of binary trees?
Why hashmap is faster than hashtable?
Why hashmap is faster than hashset?
Which is the parent class of list
What is the difference between sorting and classifying?
Can we make hashmap synchronized?
Why is arraylist not thread safe?
What is data structure and why it is important?
What is inplace sorting?