title: How variables are getting assigned in this code?
body: <p>I was writing code for checking binary tree balanced or not and came across below snippet, this works perfectly fine but I am failing to understand when and how values for 'lh' and 'lr' variables are getting assigned in below code. These are out vairables and this is c# code.</p>
  
  <pre><code>public bool IsBalanced(Node node,out int height, bool isleft)
  {
      int lh, lr;
      if(node==null)
      {
          height = 0;
          Console.WriteLine("NULL");
          return true;
      }
      if (isleft)
          Console.WriteLine("L " + node.data);
      else if(!isleft)
          Console.WriteLine("R " + node.data);
      bool balanced = IsBalanced(node.left,out lh, true) &amp; IsBalanced(node.right,out lr,false);
      height = Math.Max(lh, lr) + 1;
      Console.WriteLine("lh :" + lh + " and " + "lr :" +lr);
      Console.WriteLine("height :" + height);
      return balanced &amp; (Math.Abs(lh - lr) &lt;=1);
  }
  </code></pre>