title: Finding Least Common Ancestor in Binary Tree
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1484473/how-can-i-find-the-common-ancestor-of-two-nodes-in-a-binary-tree">How can I find the common ancestor of two nodes in a binary tree?</a><br>
    <a href="https://stackoverflow.com/questions/10133332/first-common-ancestor-of-a-binary-tree">first common ancestor of a binary tree</a>  </p>
  </blockquote>
  
  
  
  <p>I have a binary tree as below. I need to find the least common ancestor (LCA). e.g LCA of 6 and 4 is 1, LCA of 4 and 5 is 2.</p>
  
  <pre><code>    1
     / \
    2   3
   / \ / \
  4  5 6  7 
  </code></pre>
  
  <p>Can anyone please suggest how should I approach and solve this problem? </p>