Now that we have all of the functionality of a Hash Map, it’s time to review what we’ve learned!
Create a hash map
hash_map. Give it an array size over
Assign the following key-value pairs to
Retrieve the value from each of the three keys from
hash_map. Print them out!
Congratulations! You implemented a fully-functional hash map! Some things to consider:
- How would you delete a key-value pair from this hash map?
- Parts of the code are a little repetitive, how would you factor these roles differently?
- What should your hash map do if a key-value is added and the array is full? How does this hash map handle that?