예제 #1
0
 public void ForEachInOrder(NodeValueAction action)
 {
     if (Left != null)
     {
         Left.ForEachInOrder(action);
     }
     action(x);
     if (Right != null)
     {
         Right.ForEachInOrder(action);
     }
 }
예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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);
            }
        }
예제 #5
0
파일: Treap.cs 프로젝트: hxhlb/wordlight
 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);
 }
예제 #6
0
파일: Treap.cs 프로젝트: hxhlb/wordlight
        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);
        }
예제 #7
0
파일: Treap.cs 프로젝트: hxhlb/wordlight
 public void ForEachInOrder(NodeValueAction action)
 {
     if (Left != null)
         Left.ForEachInOrder(action);
     action(x);
     if (Right != null)
         Right.ForEachInOrder(action);
 }
예제 #8
0
파일: Treap.cs 프로젝트: hxhlb/wordlight
 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);
 }