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
Where is binary tree used?
What do u mean by data type?
What is the complexity of adding an element to the heap?
Does arraylist allow null values?
Which sorting algorithm is best for large data?
Is arraylist better than array?
Mention for which header list, you will found the last node contains the null pointer?
How many pointers are necessary to implement a simple linked list?
Write a data structure for a queue.
What is a bubble sort and how do you perform it?
What do you understand by stable sort?
Where is data structure used?
What is a B tree?
What is the minimum number of nodes that a binary tree can have?
How do you sort an arraylist in descending order?