Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started