public bool IsSubsetOf(MySet <T> b) { foreach (var element in this) { if (!b.Contains(element)) { return(false); } } return(true); }
public MySet <T> IntersectWith(MySet <T> b) { var resultSet = new MySet <T>(); foreach (var element in this) { if (b.Contains(element)) { resultSet.Add(element); } } return(resultSet); }