Esempio n. 1
0
 public void ForEachInOrder(NodeValueAction action)
 {
     if (Left != null)
     {
         Left.ForEachInOrder(action);
     }
     action(x);
     if (Right != null)
     {
         Right.ForEachInOrder(action);
     }
 }
Esempio n. 2
0
 public void ForEachGreaterThan(int min, NodeValueAction action)
 {
     if (Left != null && x > min)
     {
         Left.ForEachGreaterThan(min, action);
     }
     if (x > min)
     {
         action(x);
     }
     if (Right != null)
     {
         Right.ForEachGreaterThan(min, action);
     }
 }
Esempio n. 3
0
 public void ForEachLessThan(int max, NodeValueAction action)
 {
     if (Left != null)
     {
         Left.ForEachLessThan(max, action);
     }
     if (x < max)
     {
         action(x);
     }
     if (Right != null && x < max)
     {
         Right.ForEachLessThan(max, action);
     }
 }
Esempio n. 4
0
        public void ForEachInOrderBetween(int min, int max, NodeValueAction action)
        {
            if (Left != null && min < x)
            {
                Left.ForEachInOrderBetween(min, max, action);
            }

            if (min <= x && x <= max)
            {
                action(x);
            }

            if (Right != null && x < max)
            {
                Right.ForEachInOrderBetween(min, max, action);
            }
        }
Esempio n. 5
0
 public void ForEachLessThan(int max, NodeValueAction action)
 {
     if (Left != null)
         Left.ForEachLessThan(max, action);
     if (x < max)
         action(x);
     if (Right != null && x < max)
         Right.ForEachLessThan(max, action);
 }
Esempio n. 6
0
        public void ForEachInOrderBetween(int min, int max, NodeValueAction action)
        {
            if (Left != null && min < x)
                Left.ForEachInOrderBetween(min, max, action);

            if (min <= x && x <= max)
                action(x);

            if (Right != null && x < max)
                Right.ForEachInOrderBetween(min, max, action);
        }
Esempio n. 7
0
 public void ForEachInOrder(NodeValueAction action)
 {
     if (Left != null)
         Left.ForEachInOrder(action);
     action(x);
     if (Right != null)
         Right.ForEachInOrder(action);
 }
Esempio n. 8
0
 public void ForEachGreaterThan(int min, NodeValueAction action)
 {
     if (Left != null && x > min)
         Left.ForEachGreaterThan(min, action);
     if (x > min)
         action(x);
     if (Right != null)
         Right.ForEachGreaterThan(min, action);
 }