ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Operating Systems >> Data Structures
 
 


 

 
 Windows interview questions  Windows Interview Questions (339)
 Linux interview questions  Linux Interview Questions (449)
 Unix interview questions  Unix Interview Questions (455)
 Solaris interview questions  Solaris Interview Questions (781)
 RTOS interview questions  RTOS Interview Questions (43)
 Bulnex interview questions  Bulnex Interview Questions (4)
 Operating Systems General Concepts interview questions  Operating Systems General Concepts Interview Questions (261)
 Data Structures interview questions  Data Structures Interview Questions (66)
 Operating Systems AllOther interview questions  Operating Systems AllOther Interview Questions (47)
Question
How many different binary trees and binary search trees can
be made from three nodes that contain the key values 1, 2 & 3?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
Answer
# 21
binary search tree=(2^n)-n i.e (2^3)-3=5
binary tree=((2^n)-n)*n! i.e ((2^3)-3)*3!=30


this is the right answer!!!!
 
Is This Answer Correct ?    2 Yes 4 No
Shalini
 
  Re: How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
Answer
# 22
30,6 
Is This Answer Correct ?    0 Yes 2 No
Unknown
 
  Re: How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
Answer
# 23
1oth answer is xactly correst ie,BST=5 & BT=30 
Is This Answer Correct ?    5 Yes 0 No
Baljinder
 
  Re: How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
Answer
# 24
binary seach tree will be one withh 2as root node
and 1 as left child and 3 as right child of root(2).
 
Is This Answer Correct ?    0 Yes 1 No
Mann
 
  Re: How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
Answer
# 25
number of binary search tree= (2n)!/{n!*(n+1)!}
and number of binary tree=(2n)!/(n+1)!
 
Is This Answer Correct ?    1 Yes 0 No
Vipul
 
  Re: How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
Answer
# 26
30 binary trees 10 for each 1,2 and 3.
only 1 binary search tree as with 2 as root node 1 as right child and 3 as left child.
 
Is This Answer Correct ?    0 Yes 0 No
Anonymous
 
  Re: How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
Answer
# 27
binary tree = n!(2^n - n).
for n =3 its 30.

for BST its 2n
C * [1/(n+1)]
n
for n=3 its 5.
 
Is This Answer Correct ?    1 Yes 0 No
Rohit
 
  Re: How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
Answer
# 28
Formula For BST is
{(2n)!/(n!*n)}/(n+1)
So for
N=1 BST=1
N=2 BST=2
N=3 BST=5
N=4 BST=14
N=5 BST=42
and so on
 
Is This Answer Correct ?    1 Yes 0 No
Hazrat Hussain
 

 
 
 
Other Data Structures Interview Questions
 
  Question Asked @ Answers
 
I am given a sequential algorithm that does a routine search on an unordered list. N = 20. The probability that the value x does NOT appear in the list is exactly 60%, and the probability that x DOES appear is 40%. The 3 questions that I could not get were: A) What is the avg number of element comparisons performed when n = 20 and x does NOT appear in the List. (my answer was 20, is this correct?) B) What is the avg number of element comparisons peformed when n = 20 and x DOES appear in the list? C) What is the avg number of element comparisons performed when n = 20. This should be a single number answer they said.   3
why do tree always takes o(log n) time? TCS 1
what is hashing Infosys 7
how to find the number of possible tree in the given tree. Wipro 12
what is the need of data structure   11
What is B+ tree? BMC 6
input function and output function in c language Tcs 2
Write the programs for Linked List (Insertion and Deletion) operations Persistent 8
What data structure would you mostly likely see in a non recursive implementation of a recursive algorithm? CTS 3
what is atmost complete binary tree?   6
How would you sort a linked list?   4
Explain binary searching, Fibinocci search. IBM 5
 
For more Data Structures Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com