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

Implementation

The declaration of the class ChainedScatterTable is given in Program gif. The scatter table is implemented as an array of elements of the nested type Entry. Each Entry instance has two member variables--object and next. The former is a pointer to a contained object. The latter indicates the position in the array of the next element of a chain. The value of the enumerated constant null will be used instead of zero to mark the end of a chain. The value zero is not used to mark the end of a chain because zero is a valid array subscript.

   program12444
Program: ChainedScatterTable Class Definition

The ChainedScatterTable class contains a single member variable--array. It is declared as an array of ChainedScatterTable::Entry objects.


next up previous contents index

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