title: Find the longest path between any two nodes
body: <p>I have a binary tree. I need to write Java recursive method that will give longest path between two nodes.</p>
  
  <p>For example longest path if following tree is 7 (7-8-5-13-15-18-16-17).</p>
  
  <p><a href="http://img294.imageshack.us/img294/130/treeb.jpg" rel="nofollow noreferrer">http://img294.imageshack.us/img294/130/treeb.jpg</a></p>
  
  <p>What's the way to resolve this problem?</p>
  
  <p>(The method: public static int longestPath(Node n) )</p>