AlgorithmsDisjointSetsT Method (IEnumerableT, IEnumerableT, IEqualityComparerT) |
Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they
have no common items.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static bool DisjointSets<T>(
IEnumerable<T> collection1,
IEnumerable<T> collection2,
IEqualityComparer<T> equalityComparer
)
public:
generic<typename T>
static bool DisjointSets(
IEnumerable<T>^ collection1,
IEnumerable<T>^ collection2,
IEqualityComparer<T>^ equalityComparer
)
Parameters
- collection1
- Type: System.Collections.GenericIEnumerableT
The first collection. - collection2
- Type: System.Collections.GenericIEnumerableT
The second collection. - equalityComparer
- Type: System.Collections.GenericIEqualityComparerT
The IEqualityComparerComparer<T> used to compare items for equality.
Only the Equals and GetHashCode member functions of this interface are called.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.DisjointSets``1(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEqualityComparer{``0})"]
Return Value
Type:
BooleanTrue if
collection1 are
collection2 are disjoint, considered as sets.
Exceptions
RemarksIf both collections are Set, Bag, OrderedSet, or OrderedBag
collections, it is more efficient to use the IsDisjoint method on that class.
See Also