Beispiel #1
0
        public bool IsSubsetOf(MySet <T> b)
        {
            foreach (var element in this)
            {
                if (!b.Contains(element))
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #2
0
        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);
        }