**fig5_13.txt** /* 1*/ static const Default_Size = 101; /* 2*/ template /* 3*/ class Hash_Table /* 4*/ { /* 5*/ public: /* 6*/ enum Kind_Of_Entry { Legitimate, Empty, Deleted }; /* 7*/ protected: /* 8*/ struct Hash_Entry /* 9*/ { /*10*/ Element_Type Element; /*11*/ Kind_Of_Entry Info; /*12*/ Hash_Entry( Element_Type E = 0, /*13*/ Kind_Of_Entry i = Empty ) : /*14*/ Element( E ), Info( i ) { } /*15*/ }; /*16*/ unsigned int H_Size; /*17*/ Hash_Entry *The_Cells; /*18*/ unsigned int Current_Cell; // The last cell accessed. /*19*/ void Allocate_Cells( ); /*20*/ Hash_Table( Hash_Table & Value ); // Disabled. /*21*/ public: /*22*/ // Constructors. /*23*/ Hash_Table( unsigned int Initial_Size = Default_Size ); /*24*/ // Destructor. /*25*/ virtual ~Hash_Table( ) { delete [ ] The_Cells; } /*26*/ // Operators. /*27*/ const Hash_Table & operator = ( const Hash_Table & Value ); /*28*/ const Element_Type & operator ( ) ( ) const /*29*/ { return The_Cells[ Current_Cell ].Element; } /*30*/ // Member functions. /*31*/ virtual void Initialize_Table( ); /*32*/ virtual void Insert( const Element_Type & Key ); /*33*/ void Remove( const Element_Type & Key ); /*34*/ int Find( const Element_Type & Key ); /*35*/ };