Lowest Common Ancestor of a Binary Tree at Amazon
Medium68.7% acceptance
This problem has 75.0% frequency at Amazon.
Problem Description
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the [definition of LCA on Wikipedia](<https://en.wikipedia.org/wiki/Lowest_common_ancestor>): “The lowest common ancestor is defined between two nodes `p` and `q` as the lowest node in `T` that h...
Read full problem and hintsTopics
Also asked at 22 companies
More Amazon Questions
Number of IslandsMediumCourse ScheduleMediumWord SearchMediumBinary Tree Zigzag Level Order TraversalMediumBinary Tree Maximum Path SumHard
View all Amazon questions