Exemple #1
0
        public bool Overlaps(IEnumerable <T> other)
        {
            TwoThreeTree <T> B = new TwoThreeTree <T>(_comp);

            B.AddRange(other);
            B = Intersection(B);//A AND B

            return(B._count != 0);
        }
Exemple #2
0
        public bool SetEquals(IEnumerable <T> other)
        {
            if (other == null)
            {
                return(false);
            }
            TwoThreeTree <T> B = new TwoThreeTree <T>(_comp);

            B.AddRange(other);
            return(Equals(B));
        }
Exemple #3
0
        public void SymmetricExceptWith(IEnumerable <T> other)
        {
            if (other.Count() == 0)
            {
                return;
            }
            TwoThreeTree <T> B = new TwoThreeTree <T>(_comp);

            B.AddRange(other);
            B = SymmetricDifference(B);
            Clear();
            AddRange((IEnumerable <T>)B);
        }
Exemple #4
0
        public void IntersectWith(IEnumerable <T> other)
        {
            TwoThreeTree <T> B = new TwoThreeTree <T>(_comp);

            B.AddRange(other);
            B = Intersection(B);
            if (B._count == 0)
            {
                Clear();
                return;
            }
            Clear();
            AddRange((IEnumerable <T>)B);
        }
Exemple #5
0
        public bool IsSupersetOf(IEnumerable <T> other)
        {
            if (other.Count() == 0)
            {
                return(true);
            }
            TwoThreeTree <T> B = new TwoThreeTree <T>(_comp);

            B.AddRange(other);
            TwoThreeTree <T> C = B.Difference(this);//B\A.
            Int32            c = C._count;

            if (c == 0)
            {
                return(true);
            }
            return(false);
        }
Exemple #6
0
        public bool IsProperSubsetOf(IEnumerable <T> other)
        {
            if (other.Count() == 0)
            {
                return(false);
            }
            TwoThreeTree <T> B = new TwoThreeTree <T>(_comp);

            B.AddRange(other);
            TwoThreeTree <T> C = Difference(B);//A\B.
            Int32            c = C._count;

            if (c == 0 && B._count > _count)
            {
                return(true);
            }
            return(false);
        }
Exemple #7
0
        public bool IsSubsetOf(IEnumerable <T> other)
        {
            if (other.Count() == 0 && _count == 0)
            {
                return(true);
            }
            else if (other.Count() == 0 && _count != 0)
            {
                return(false);
            }
            TwoThreeTree <T> B = new TwoThreeTree <T>(_comp);

            B.AddRange(other);
            B = Difference(B);//A\B.
            Int32 c = B._count;

            if (c == 0)
            {
                return(true);
            }
            return(false);
        }