Checks if two sets are disjoint; that is, if both sets have no elements in common.
A ∩ B = ϕ
O(m * n)
m = |B|
n = |A|
Set A of type <TElement> elements
<TElement>
Set B of type <TElement> elements
Whether A ∩ B = ϕ is true
Set.prototype.isDisjointFrom
// {1, 2, 3} ∩ {4, 5, 6} = ϕareSetsDisjoint(new Set([1, 2, 3]), new Set([4, 5, 6])); // true// {1, 2, 3} ∩ {3, 4, 5} ≠ ϕareSetsDisjoint(new Set([1, 2, 3]), new Set([3, 4, 5])); // false Copy
// {1, 2, 3} ∩ {4, 5, 6} = ϕareSetsDisjoint(new Set([1, 2, 3]), new Set([4, 5, 6])); // true// {1, 2, 3} ∩ {3, 4, 5} ≠ ϕareSetsDisjoint(new Set([1, 2, 3]), new Set([3, 4, 5])); // false
Generated using TypeDoc
Checks if two sets are disjoint; that is, if both sets have no elements in common.
A ∩ B = ϕ
O(m * n)
, wherem = |B|
(size of set B) andn = |A|
(size of set A).