Question: i will write below the hashtable: #include #include #include using namespace std; class HashTable { public: HashTable(int size) : size_(size) { table_ = new vector(size);
i will write below the hashtable:
#include
#include
#include
using namespace std;
class HashTable {
public:
HashTable(int size) : size_(size) {
table_ = new vector(size);
for (int i = 0; i
table_[i].first = "";
table_[i].second = 0;
}
}
~HashTable() {
delete table_;
}
int size() {
return size_;
}
void insert(string key, int value) {
int hash = hash_function(key);
while (table_[hash].first != "" && table_[hash].first != key) {
hash = (hash + 1) % size_;
}
table_[hash].first = key;
table_[hash].second = value;
}
int get(string key) {
int hash = hash_function(key);
while (table_[hash].first != "" && table_[hash].first != key) {
hash = (hash + 1) % size_;
}
return table_[hash].second;
}
private:
int size_;
vector* table_;
};
now please continue solving task 2 that talks about the unordered_map make the code for it and make a program compare the time efficiency of the hashtable and the unordered_map and use the heap to get the top 10 visited pages

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
