The sets described in Chapter 9 can hold arbitrary elements because the elements are manipulated only by functions supplied by clients. Sets of integers are less flexible, but they’re used often enough to warrant a separate ADT. The
Bit interface exports functions that manipulate bit vectors, which can be used to represent sets of integers from zero to
N−1. For example, 256-bit vectors can be used to represent sets of characters efficiently.
Bit provides most of the set-manipulation functions provided by
Set, and also a few functions that are specific to bit vectors. Unlike the sets provided by
Set, the sets represented by bit vectors have a well-defined universe, which is the set of integers in the range zero to
N−1. Thus, ...