How to find the lowest common ancestor of two nodes in any binary tree?

The Binary Tree here is may not necessarily be a Binary Search Tree. The structure could be taken as – struct node { int data; struct node *left; struct node *right; }; The maximum solution I could work out with a friend was something of this sort – Consider this binary tree : The inorder … Read more