Wintellect.PowerCollections Namespace
Algorithms Class
GhostDoc Pro Sample Help File

Bag<(Of <(<'T>)>)>..::..IsDisjointFrom Method

Determines if this bag is disjoint from another bag. Two bags are disjoint if no item from one set is equal to any item in the other bag.

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

Syntax


public bool IsDisjointFrom(
	Bag<T> otherBag
)
Public Function IsDisjointFrom ( _
	otherBag As Bag(Of T) _
) As Boolean
public:
bool^ IsDisjointFrom(
	Bag<T>^ otherBag
)

Parameters

otherBag
Type: Wintellect.PowerCollections..::..Bag<(Of <(<'T>)>)>
Bag to check disjointness with.

Return Value

True if the two bags are disjoint, false otherwise.

Exceptions


ExceptionCondition
InvalidOperationExceptionThis bag and otherBag don't use the same method for comparing items.

Remarks


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