title: Counting BST leves on C
body: <p>There was a recursive way to count levels, this is similar but it doesn't work. Which is my mistake?</p>
  
  <pre><code>struct s_node
  {
    struct s_node * left;
    struct s_node * right;
    int value;
  }
  typedef struct s_node * t_node;
  int levels (t_node tree)
  {
    if(tree != NULL)
    {
      return 1+levels(tree-&gt;left)+levels(tree-&gt;right);
    }
    else
         return 0;
  }
  </code></pre>