title: Get height of tree with multiple children
body: <p>I'm having a hard time completing this algorithm to find the height of a tree with multiple children (not binary).</p>
  
  <p>Anyone know where this is going wrong?</p>
  
  <pre><code>private int getHeight(Node&lt;T&gt; root, int height, int result){
  
          if (root.getChildren().size()==0) {
              return height;
          }
          height++;
  
          //Iterate every child
          for (Node&lt;T&gt; childNode  : root.getChildren()) {
  
              //Get the height again
              height =getHeight(childNode, height, result);
  
              //Update if new high result
              if (height&gt;result) {
                  result = height;
              }
  
              height = 0;
          }
  
          //Return highest point
          return result;
      }
  </code></pre>