http://www.geeksforgeeks.org/archives/1029
On Wed, Sep 28, 2011 at 10:57 AM, Ankuj Gupta ankuj2...@gmail.com wrote:
Find lowest common ancestor of Binary Tree
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
node* LCA(node *root, node *n1, node *n2, int x)
{
int y = 0;
node *temp;
if (root-left) temp = LCA(root-left, n1, n2, y);
x += y;
if (temp != NULL) return temp;
if (x == 2) return node;
if (root-right) temp = LCA(root-right, n1, n2, y);
x += y;
if (temp != NULL) return temp;
if (x == 2) return
http://community.topcoder.com/tc?module=Staticd1=tutorialsd2=lowestCommonAncestor
chk it out..
On Wed, Sep 28, 2011 at 11:04 AM, sukran dhawan sukrandha...@gmail.comwrote:
it has already been discussed .. search in the archives
On Wed, Sep 28, 2011 at 10:57 AM, Ankuj Gupta ankuj2...@gmail.com
Find lowest common ancestor of 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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
it has already been discussed .. search in the archives
On Wed, Sep 28, 2011 at 10:57 AM, Ankuj Gupta ankuj2...@gmail.com wrote:
Find lowest common ancestor of Binary Tree
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this