What is the lowest common ancestor of 5 and 4 in this binary tree

88 views Asked by At

Binary tree

Binary tree

What is the lowest common ancestor of 5 and 4 in the binary tree above, considering we allow a node to be a descendant of itself. Wouldn't it be 3? if not, what would it be and why?

1

There are 1 answers

3
Rajan saha Raju On BEST ANSWER

As we allow a node to be a descendant of itself, LCA will be 5.