Chapter 9. Sets

A set is an unordered collection of distinct members. The basic operations on a set are testing for membership, adding members, and removing members. Other operations include set union, intersection, difference, and symmetric difference. Given two sets s and t, the union s + t is a set that contains everything in s and everything in t; the intersection s * t is the set whose members appear in both s and t, the difference s - t is the set whose members appear in s but not in t, and the symmetric difference, often written as s / t, is the set whose members appear in only one of s or t.

Sets are usually described in terms of a universe — the set of all possible members. For example, sets of characters are usually associated with the ...

Get C Interfaces and Implementations: Techniques for Creating Reusable Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.