Logic to find the LCA of tree and node has pointer to parent node.
Anonymous
you can find the LCA of 2 nodes by using DFS algo. it gives the path for both the nodes. traverse them and find the common node.
Check out your Company Bowl for anonymous work chats.