Esempio n. 1
0
File: MySet.cs Progetto: xJCM/Csharp
        public bool IsSubsetOf(MySet <T> b)
        {
            foreach (var element in this)
            {
                if (!b.Contains(element))
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 2
0
File: MySet.cs Progetto: xJCM/Csharp
        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);
        }