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); }
public bool SetEquals(IEnumerable <T> other) { if (other == null) { return(false); } TwoThreeTree <T> B = new TwoThreeTree <T>(_comp); B.AddRange(other); return(Equals(B)); }
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); }
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); }
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); }
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); }
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); }