title: Calculating the height of a binary tree
body: <p>I need help with the theory on calculating the height of a binary tree, typically the notation.</p>
  
  <p>I have read the following article:</p>
  
  <p><a href="https://stackoverflow.com/questions/575772/the-best-way-to-calculate-the-height-in-a-binary-search-tree-balancing-an-avl">Calculating height of a binary tree</a></p>
  
  <p>And one of the posts gives the following notation:</p>
  
  <blockquote>
    <p>height(node) = max(height(node.L), height(node.R)) + 1</p>
  </blockquote>
  
  <p>Let's assume I have the following binary tree:</p>
  
  <pre><code>     10
     /   \  
    5    30
   / \   /  \ 
  4  8  28  42
  </code></pre>
  
  <p>Do I therefore calculate the max value on the left node (8) and the max node on the right (42) and then add 1? I don't quite understand how this notation works in order to calculate the height of the tree. </p>