Assume if i have inorder, preorder and post order functions. set A =nodes which come between the two nodes in in-order set B =(nodes which come before the two nodes in pre-order) and it belongs to set A set C=nodes which come after the two nodes in post-order and it belongs to set B
set C is the required answer. It will be one node On Fri, Jun 18, 2010 at 1:58 PM, jaladhi dave <[email protected]>wrote: > very nice and informative link. Thanks a lot :) > > > On Thu, Jun 17, 2010 at 4:08 PM, Vivek Sundararajan < > [email protected]> wrote: > >> >> http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=lowestCommonAncestor >> >> The above link gives a detailed explanation about LCA and RMQ >> >> On 17 June 2010 15:30, jalaj jaiswal <[email protected]> wrote: >> >>> write an algo which gives the lowest common ancestor of two nodes in a >>> general tree(not binary specifically) >>> >>> -- >>> With Regards, >>> Jalaj Jaiswal >>> +919026283397 >>> B.TECH IT >>> IIIT ALLAHABAD >>> >>> -- >>> 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]<algogeeks%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> >> >> -- >> "Reduce, Reuse and Recycle" >> Regards, >> Vivek.S >> >> -- >> 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]<algogeeks%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > 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]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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.google.com/group/algogeeks?hl=en.
