Exemple #1
0
        public override void Visit(TreeLeaf leaf)
        {
            if (leaf == null)
            {
                return;
            }

            currentHeight++;
            maxHeight = Math.Max(maxHeight, currentHeight);
            currentHeight--;
        }
Exemple #2
0
 public override void Visit(TreeLeaf leaf)
 {
     if (heights.Count == 0)
     {
         currentHeight = 1;
     }
     else
     {
         currentHeight = heights[heights.Count - 1];
         heights.RemoveAt(heights.Count - 1);
     }
     maxHeight = Math.Max(maxHeight, currentHeight);
 }
Exemple #3
0
 public abstract void Visit(TreeLeaf leaf);