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 are the parts of a linked list?
Is hashmap synchronized?
Name the areas in which you can apply data structures extensively?
Which sort is stable?
Is arraylist a collection?
Which interfaces are implemented by abstractqueue?
What is array simple?
Describe tree rotation in avl tree.
What do you mean by double hashing?
Explain the priority queue?
How does a selection sort work?
Write an algorithm to show the reverse of link list?
What do you mean by collision in hashing?
Define structure property in a heap?
Write a Program for Insert in a sorted list