Question: I am trying to write 3 C++ codes 1) to implement a map (stores the key-value pairs) using the std::unordered_map 2) to implement a map
I am trying to write 3 C++ codes
1) to implement a map (stores the key-value pairs) using the std::unordered_map
2) to implement a map using a hash table with separate chaining. This should include three base methods (insert, search, and dump), a constructor, destructor, and a resize method:
void resize(const size_t new_size);
Given a new_size, this method allocates a new table of the given new_size, copies all the entries from the old table to this new table, and then deallocates the old table.
3) to implement a map using a hash table with open addressing with linear probing in open.cpp.
This includes the three base methods (insert, search, and dump), along with a constructor, destructor, resize method, and an internal locate method:
size_t locate(const std::string &key);
Given a key, this function returns the bucket that either contains this key or is the next empty bucket.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
