Wintellect.PowerCollections Namespace
Algorithms Class
GhostDoc Pro Sample Help File

Set<(Of <(<'T>)>)>..::..Intersection Method

Computes the intersection of this set with another set. The intersection of two sets is all items that appear in both of the sets. A new set is created with the intersection of the sets and is returned. This set and the other set are unchanged.

Namespace:  Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax


public Set<T> Intersection(
	Set<T> otherSet
)
Public Function Intersection ( _
	otherSet As Set(Of T) _
) As Set(Of T)
public:
Set<T>^ Intersection(
	Set<T>^ otherSet
)

Parameters

otherSet
Type: Wintellect.PowerCollections..::..Set<(Of <(<'T>)>)>
Set to intersection with.

Return Value

The intersection of the two sets.

Exceptions


ExceptionCondition
InvalidOperationExceptionThis set and otherSet don't use the same method for comparing items.

Remarks


When equal items appear in both sets, the intersection will include an arbitrary choice of one of the two equal items.

The intersection of two sets is computed in time O(N), where N is the size of the smaller set.