The no. of binary trees that can be generated having n nodes would be:
(2n C n) / (n+1) i.e the catalan no.

On Dec 28, 12:06 am, bugaboo <bharath.sri...@gmail.com> wrote:
> Given an inorder traversal only for a binary tree (not necessarily a
> BST), give a pseudo code to generate all possible binary trees for
> this traversal sequence.
>
> Firstly, how many binary trees can be generated given an in-order
> traversal? I know that given 'n' nodes, number of BTs possible is
> (2^n)-n. But if we are given a specific in-order sequence, can we cut
> down on this number?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to