Given 2 nodes(say, pointer to the node is given) in a binary tree, find the closest common ancestor.
- Code:
Input:
1
2 3
4 5 6 7
8 9 10 11 12 13 14 15
Output:
Closest Common ancestor :
(9,11) -> 2
(9,14) -> 1