Determine if a binary tree is balanced I'm currently running through some Cracking the Coding Interview questions and my solution to 4-4 is quite different from any of the given solutions.

The question asks to determine if a given binary tree is balanced; more specifically, if the difference between the maximum and minimum depths within the tree is less than or equal to 1.

public static bool IsBalanced(Node node)
{
    var mm = new DepthMinMax();
    mm.Min = int.MaxValue;
    mm.Max = int.MinValue;

    FindMinMax(mm, node, 0);

    return (mm.Max - mm.Min &lt;= 1) ? true : false;
}

private static void FindMinMax(DepthMinMax mm, Node node, int depth)
{
    if (node == null) return;

    FindMinMax(mm, node.L, depth + 1);
    FindMinMax(mm, node.R, depth + 1);

    // At a terminating node
    if (node.L == null || node.R == null)
    {
        if (mm.Min &gt; depth) mm.Min = depth;
        if (mm.Max &lt; depth) mm.Max = depth;
    }
}

public class Node
{
    public Node L { get; set; }
    public Node R { get; set; }
}

public class DepthMinMax
{
    public int Min { get; set; }
    public int Max { get; set; }
}


This works for my test cases, but they were far from exhaustive and I can't really conclude if my solution works for all cases / is efficient. My solution feels far too simple, which leads me to believe I've missed some kind of gotcha.
Came across this post as I was answering the same question in this book. My approach was also similar in solving this. I will post what I found 
as an answer since I cannot comment.  

First, I think the or condition for checking the terminating 
node is incorrect. It should be a and condition to my understanding. I think we need to identify whether the current node is a leaf node before 
updating depths. 
For the following tree this would give a max depth of 3 and min depth of 1, which is incorrect. I did this in C++ as shown below.  

      5
     /  \
    4    7
   /    / \
  1    6   8 
 /
0  


 void FindMinMax(int &amp;min,int &amp;max,Node *np,int height)
 {
     if(np==NULL) return;
     FindMinMax(min,max,np-&gt;left,height+1);
     FindMinMax(min,max,np-&gt;right,height+1);

     if(np-&gt;left==NULL || np-&gt;right==NULL)
     {
         if(min&gt;height) min = height;
         if(max&lt;height) max = height;
     }
 }


Second, I am not sure whether there are differences in the versions. 
In my book the question 4.1 is about checking whether a binary tree is balanced. This is defined as 


  heights of the two subtrees of any node never differ by more than one


If this is the requirement I think this algorithm won't work. 
Check the first two answers of this question. I think this algorithms checks whether the difference between farthest and closest leaves from root differ by more than one. 

Edit: Here I assumed min max corresponds to maximum and minimum depths to leaf nodes.