:).
Apparently, Ravi has an assumption that each BST should be constructed
with same method. And the first one is choosen as a root.

In fact, if two lists have identical elements, they have identical BST
sets.

At least, if we focus on Ravi's problem, this problem will be reduced
to order comparison between two strings.

And it can be handled in O(N).

On Nov 1, 2:23 pm, "Vijendra Singh" <[EMAIL PROTECTED]> wrote:
> Oh ok.. I got confused... lemme think about this one. I think it has a
> recursive soltuion but will confirm it.
>
> -Vijju
>
> On 11/1/06, ravi <[EMAIL PROTECTED]> wrote:
>
>
>
> > I think u have misunderstood the question.
>
> > I am not asking about the two lists have identical elements  or not?
>
> > If we have two lists then how will we check whther two lists  produce
> > identical BSTs or not?
>
> > For example
>
> > L1 = { 10, 5, 15 }
> > L2 = { 5 , 10, 15 }
> > L3 = { 10, 15, 5 }
>
> > L1, L2, L3 all have identical elements.
> > But only L1, L3 will produce identical BSTs.
>
> > L1, L3 produce tree as        10
> >                                     5        15
>
> > L2 produce BST as             5
> >                                               10
> >                                                      15
> 
> > I think now the question is clear?????


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups-beta.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to