TO find common ancestor of two nodes in a tree