//Return the intersection between this set and the one pass as an argument. O(n*m) public SetInterface Intersection(SetInterface set) { ArraySet res = new ArraySet(); for (int i = 0; i < _size; i++) { if (set.Contains(_items[i])) { res.Add(_items[i]); } } return(res); }
//Return the union of this set with the one pass as an argument. O(n*m) public SetInterface Union(SetInterface set) { ArraySet res = new ArraySet(set.Enumerate()); for (int i = 0; i < _size; i++) { if (!set.Contains(_items[i])) { res.Add(_items[i]); } } return(res); }