Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / shweta

for no. of different binary tree---
for n nodes the formula is 2^n-n in this formula value of
nodes are not considered, only the way nodes can be present
in a tree so for 3 nodes there can be 5 ways, for each way
no. of possibilty of values is 3! so answer comes out to be
5*6=30

1 1 1 1 1
A A A A A
2 3 2 2 2 2

A A A A
3 3 3 3

for binary search tree answer is 3

Is This Answer Correct ?    19 Yes 42 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where is binary tree used?

958


What do u mean by data type?

928


What is the complexity of adding an element to the heap?

987


Does arraylist allow null values?

1004


Which sorting algorithm is best for large data?

928


Is arraylist better than array?

1013


Mention for which header list, you will found the last node contains the null pointer?

900


How many pointers are necessary to implement a simple linked list?

1177


Write a data structure for a queue.

1292


What is a bubble sort and how do you perform it?

1074


What do you understand by stable sort?

939


Where is data structure used?

1025


What is a B tree?

1055


What is the minimum number of nodes that a binary tree can have?

1210


How do you sort an arraylist in descending order?

839