We can find the solution in O(n) where n is number of nodes.
Do an in-order traversal of the binary tree. then scan through the numbers
and find the list and find the longest(increasing or decreasing) sequence.
That is the size of maximum size of BST in the given binary tree.

On Wed, Jun 23, 2010 at 11:40 AM, Raj N <rajn...@gmail.com> wrote:

> Find the maximum size Binary search tree in a binary tree??
>
> --
> 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<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
----------------------------------------------------------------------
If u doubt your believes,u believe ur doubts
If u fail to practise,u practises failure
------------------------------------------------------------
Thanks and Regards
GopiNath

-- 
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.

Reply via email to