Question
In the context of this exercise, why is the key being stored along with the value?
Answer
In order to implement open addressing, we need to store the keys along with the values in our hash map.
When we add a key-value, the key either already exists in the hash map, or it does not. By storing the keys, we can compare each of them with our added key. If the key already exists, we would overwrite the current value, and if not, we will add the new key-value pair to the hash map.