Question: Part 2 : Unordered Map ( 4 0 % ) - similar to maps, unordered maps are associative containers that store key - value pairs.

Part 2: Unordered Map (40%)- similar to maps, unordered maps are associative containers that store key-value pairs.
However, the unordered map is implemented using a hash table instead of a tree, which allows for O(1) find and remove. The
drawback is that the elements are no longer ordered, so it does not support find Min or find Max, and cannot produce a sorted
output using iterator traversal.
Implement an unordered map ADI using a hash table (separate chaining or double hashing) as the underlying data structure.
You may use std libraries for the linked list (separate chaining) and hash functions. If the hash table becomes overloaded (>
0.5) it should allocate more space and rehash all the existing elements. Don't forget the big 5!
mapped_types operator[](const key_types k);
if k matches the key of an element in the container, the function returns a reference to its mapped value. If k
does not match the key of any element, insert a new key-value pair with key k and value constructed using
mapped_type default constructor and return a reference to the new mapped_type object.
Pairkkkkk
Part 2 : Unordered Map ( 4 0 % ) - similar to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!