Question: Start with code: #include const int TABLE _ SIZE = 1 7 ; class HashMap { private: HashEntry * table; public: HashMap ( ) {
Start with code:
#include
const int TABLESIZE ;
class HashMap
private:
HashEntry table;
public:
HashMap
table new HashEntryTABLESIZE;
for int i ; i TABLESIZE; i
tablei NULL;
int getint key
int hash key TABLESIZE;
while tablehash NULL && tablehashgetKey key
hash hash TABLESIZE;
if tablehash NULL
return ;
else
return tablehashgetValue;
void insertint value
int hash value TABLESIZE;
ifgetvalue
table.pushbackvalue;
else ifgetvalue
tablehashgetValuevalue;
~HashMap
for int i ; i TABLESIZE; i
if tablei NULL
delete tablei;
delete table;
;
int mainint argc, const char argv
HashMap Kirsten;
Kirsten.insert;
Then write the main and insert function to insert the sequence of integers using a table of size Then implement rehashing algorithm of choice and run the same sequence of input using a table of size
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
