title: Print the Longest leaf-to-leaf path in a binary tree along with its length
body: <p>I am solving a problem in which I have to find the longest leaf-to-leaf path in a binary tree along with its length.</p>
  
  <p>for example, if the Binary tree is as follows:</p>
  
  <pre><code>         a
           /\
          b c
        /   / \
       d   e  f 
      / \      \
     g  h      p
         \
          k
  </code></pre>
  
  <p>The longest leaf-to-leaf path would be <em>k-h-d-b-a-c-f-p</em> which is of length <em>8</em>.</p>
  
  <p>I am calculating the length by recursively finding the length of the left and right sub-tree and then <code>return height_left + height_right + 1</code> . Is my concept correct?.</p>
  
  <p>Also how should I print the longest leaf-to-leaf path? I just want an idea to proceed.</p>