Added support to find LCA with and without parent pointer