JAVA code to find LCA of given two nodes in a tree
import java . util . * ; public class GFG { static int maxn = 100005 ; static int left ( int i ) { return ( 2 * i + 1 ) ; } static int right ( int i ) { return 2 * i + 2 ; }