O'Reilly logo

C Interfaces and Implementations: Techniques for Creating Reusable Software by David R. Hanson - Princeton University

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Bit Vectors

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required