Lowest common ancestor of a binary tree

Here we are finding the lowest common ancestor of a binary tree. Here if the root2 is in between data 1 and data2 then we found
out ancestor.

Result: 30

Leave a Reply

Your email address will not be published. Required fields are marked *