void Analyze(out List<int> depths, out int minDepth, out int maxDepth, out int nodeCount)
{
depths = new List<int>();
nodeCount = 0;
root.Analyze(depths, 0, ref nodeCount);
maxDepth = 0;
minDepth = int.MaxValue;
for (int i = 0; i < depths.Count; i++)
{
if (depths[i] > maxDepth)
maxDepth = depths[i];
if (depths[i] < minDepth)
minDepth = depths[i];
}
}