Given a binary tree and two nodes. Find Least Common Ancestor (LCA) of the two nodes.
For example given the tree T below. LCA(T, 5, 6) = 3, LCA(T, 4, 6) = 1, etc.
Given a binary tree and two nodes. Find Least Common Ancestor (LCA) of the two nodes.
For example given the tree T below. LCA(T, 5, 6) = 3, LCA(T, 4, 6) = 1, etc.