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
Is Arraylist faster than Array? Why?
Is it legal to initialize list like this?
Define balancing condition for AVL Tree.
How do you make a bubble chart with 3 variables?
Which is better merge or quick sort?
What is the difference between a Stack and a Queue.
Differentiate between hashmap and treemap.
What are the advantages and disadvantages of copyonwritearraylist?
What is arraylist load factor?
write a program to show the insertion and deletion of an element in an array using the position
What is 1d array?
Define graph traversals?
What is difference between stack and queue?
Can a stack be described as a pointer? Explain.
Explain the Queue