title: Find the maximum depth of a tree
body: <p>I have a tree data structure with N first-level child nodes that have childs too.</p>
  
  <p>For example:</p>
  
  <ul>
     <li>Root</li>
     <ul>
        <li>Node1</li>
        <ul>
            <li>Node11</li>
            <ul>
              <li>Node111</li>
              <ul>
                 <li>Node1111</li>
              </ul>
            </ul>
            <li>Node12</li>
        </ul>
  <li>Node2</li>
  <ul>
  <li>Node21</li>
  <ul>
  <li>Node211</li>
  </ul>
  </ul>
  </ul>
  </ul>
  
  <p>I would like to know which of the braches has the biggest depth. As in the previous example it will be </p>
  
  <blockquote>Node1 - Node11 - Node111 - Node1111</blockquote>
  
  <p>that has a depth of four levels.</p>
  
  <p>Any suggestion?</p>
  
  <p>Thanks!</p>