예제 #1
0
 public static bool isSubsetOf(ArraySet a, ArraySet b)
 {
     foreach (object i in a.data)
     {
         if (!b.contains((double)i))
         {
             return(false);
         }
     }
     return(true);
 }
예제 #2
0
        public ArraySet difference(ArraySet e)
        {
            ArraySet temp = (ArraySet)this.Clone();

            foreach (double i in this.data)
            {
                if (e.contains(i))
                {
                    temp.remove(i);
                }
            }
            return(temp);
        }
예제 #3
0
        public ArraySet Union(ArraySet e)
        {
            ArraySet temp = (ArraySet)this.Clone();

            foreach (double j in e.data)
            {
                if (!temp.contains(j))
                {
                    temp.add(j);
                }
            }
            return(temp);
        }