Set - Difference

1 - About

difference is an operation between two sets.

3 - Type

3.1 - Asymmetric

In a asymmetric difference, the difference element come only from the first set.

The asymmetric difference
of 1 2 3 4
and 3 4 5 6
is 1 2

Implementation:

  • loop over setA
  • does setB has element of setA
  • if yes, return the element

3.2 - Symmetric

The symmetric difference is the union of the two asymmetric difference

  • asymmetric diff SetA to SetB
  • asymmetric diff SetB to SetA
The symmetric difference
of 1 2 3 4
and 3 4 5 6
is 1 2 5 6

Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap