## Set theory

The concept of a set is relatively simple, but in practice a concrete implementation can be somewhat difficult to understand due to its mathematical origins. Therefore, in order to fully appreciate the set data structure, it becomes necessary to examine some of the characteristics and functions of **set theory** upon which the set data structure is built. Set theory is a branch of mathematics that studies collections, or *sets*, of objects. Although set theory is a major area of research in mathematics with many interrelated sub-fields, we really only need to examine five functions for combining and relating sets to one another to understand the set data structure:

**Union**: A union is one of the fundamental methods of combining and relating sets to one another. A union of a series of*n*sets is the set of only those distinct elements contained in those sets. This means that, if you combine sets*A*and*B*, the resulting set will only contain unique elements from set*A*and*B*. If an element...