Data Structures and Algorithms with Object-Oriented Design Patterns in C#
next up previous contents index


In this chapter we consider sets the elements of which are integers. By using integers as the universe rather than arbitrary objects, certain optimizations are possible. For example, we can use a bit-vector of length N to represent a set whose universe is tex2html_wrap_inline66417. Of course, using integers as the universe does not preclude the use of more complex objects, provided there is a one-to-one mapping between those objects and the elements of the universal set.

A crucial requirement of any set representation scheme is that it supports the common set operations including union , intersection , and set difference . We also need to compare sets and, specifically, to determine whether a given set is a subset of another.

next up previous contents index

Bruno Copyright © 2001 by Bruno R. Preiss, P.Eng. All rights reserved.