Re: [algogeeks] Maximum size binary search tree

2010-08-15 Thread Ankit Singh
First do a level order traversal.Let the result of level order traversal be stored in a list l (ListTree l = new ArrayListTree). Then we can do similar to level order once again.There will be two loops. Outer loop will take an element from list l and treat it as root and the inner loop will do

Re: [algogeeks] Maximum size binary search tree

2010-08-15 Thread Ankit Singh
Space complexity- O(n), Time - O(n2). -- 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

Re: [algogeeks] Maximum size binary search tree

2010-08-15 Thread Shiv ...
Gopinath's solution can be extended by adding one more logic. Do in-order traversal, store it in an array or something. Keep resetting this data-structure if you hit a right leaf or a non-increasing number. Well we will need two such arrays, one for storing the current increasing sequence and

Re: [algogeeks] Maximum size binary search tree

2010-08-11 Thread Divya Jain
@ above ur soln ll fail in situation like 10 / \ 15 18 /\ / \ 22 7 17 77 the inorder is 22 15 7 10 17 18 77 so the longest increasing sequence is 7-77 but this

[algogeeks] Maximum size binary search tree

2010-06-23 Thread Raj N
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