Number of BST with n keys f(n) = [ \sum_{ i=1 to n} f(i-1)* f(n- i) ] Root node can be any of n keys. if it is ith ney in ascending order, it has i-1 keys to left and n-i keys to right.
Can any one explain how/Why is it equal to catalan number? -Thanks Bujji On Aug 1, 1:08 pm, Manjunath Manohar <manjunath.n...@gmail.com> wrote: > int count(int node) > { > int sum=0;i,left,right; > for(i=0;i<node;i++) > { > left=count(node-1); > right=count(node-i); > sum+=left*right; > } > return(sum); > > > > }- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.