示例#1
0
        public PowerSet <T> Union(PowerSet <T> set2)
        {
            var union = new PowerSet <T>();

            foreach (var val in set2.ToArray())
            {
                union.Put(val);
            }

            foreach (var val in this.ToArray())
            {
                union.Put(val);
            }

            return(union);
        }
示例#2
0
        public PowerSet <T> Intersection(PowerSet <T> set2)
        {
            var intersection = new PowerSet <T>();

            foreach (var val in set2.ToArray())
            {
                if (this.Get(val))
                {
                    intersection.Put(val);
                }
            }
            return(intersection);
        }