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
What are linked lists used for?
Is binary tree a binary search tree?
Explain the term recursive case?
What is treemap chart?
Define disjoint set adt?
What is the most used data structure?
How to show internal storage representation of data structure in RDBM?
What is the basic of data structure?
Now you are given an array of a characters (both ASCII and Kanji) and, an index into the array. The index points to the start of some character. Now you need to write a function to do a backspace (i.e. delete the character before the given index).
What do you mean by sorting data?
What happens if an array goes out-of-bounds?
What is data type and its types?
Model a data structure for a DFA that takes an event as parameter and performs a desired action.
Why set will not allow duplicates?
How to reverse a singly linked list?