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); }
public bool IsSubset(PowerSet <T> set2) { var subSet = set2.ToArray(); foreach (var element in subSet) { if (!this.Get(element)) { return(false); } } return(true); }
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); }