Question: In c + + template class Table { public: static const std::size _ t CAPACITY = 8 1 1 ; table ( ) ; void
In c
template
class Table
public:
static const std::sizet CAPACITY ;
table;
void insertconst ReacordType &entry
bool alreadPresent;
std::sizet index;
assertentrykey ;
findIndexentrykey, alreadyPresent, index;
if alreadyPresent
assertsize CAPACITY;
index hashentrykey;
while isVacantindex
index nextIndexindex;
used;
dataindex entry;
void removeint key
bool found;
std::sizet index;
assertkey ;
findIndexkey found, index;
if found
dataindexkey PREVIOUSLYUSED;
used;
bool isPresentint key const;
void findint key, bool &found, RecordType &result const;
std::sizet size const return used;
private:
static const int NEVERUSED ;
static const int PREVIOUSLYUSED ;
RecordType dataCAPACITY;
std::sizet used;
std::sizet hashint key const;
std::sizet nextIndexstd::sizet index const;
void findIndexint key, bool &found, std::sizet &index const
std::sizet count;
count ;
i hashkey;
while count CAPACITY && neverusedi && dataikey key
count;
i nextIndexi;
found dataikey key;
bool neverUsedstd::sizet index const return index NEVERUSED;
bool isVacantstd::sizet index const return index PREVIOUSLYUSED;
;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
