Given a binary tree find the LCA?
Anonymous
LCA(struct node * current, int n1, int n2) { if(current->value >=n1 && current-> val val; return; if(current->val>n1 && current->val > n2)//We know that left child is the way to proceed. LCA(current->left,n1,n2); if(current->valval right,n1,n2); }
Check out your Company Bowl for anonymous work chats.