Wednesday, February 12, 2014

Lastest Common Ancester



Find the Latest Common Ancestor of two TreeNode.
For Example,
Given
         1
        / \
       2   5
      / \   \
     3   4   6

 The LCA of 3 and 4 is 2. 5 and 6 is 5.

No comments:

Post a Comment