Пример #1
0
        public SimpleSet <T> Difference(SimpleSet <T> secondSet)
        {
            SimpleSet <T> newSet = new SimpleSet <T>(items);

            foreach (var item in secondSet.items)
            {
                newSet.Remove(item);
            }

            return(newSet);
        }
Пример #2
0
        public SimpleSet <T> Difference(SimpleSet <T> set)
        {
            // return new SimpleSet<T>(_items.Except(set._items));
            var result = new SimpleSet <T>(_items);

            foreach (var item in set._items)
            {
                result.Remove(item);
            }

            return(result);
        }