Microsoft Interview Question

Logic to find the LCA of tree and node has pointer to parent node.

Interview Answer

Anonymous

Jul 12, 2016

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.