B
Bharath
Hello,
I recently used the hash_map class to create a dictionary of some
data. The template class takes the key, value, the class which
performs the compare function and a custom allocator and so on.
I have read about hashing (years ago in college), never implemented
anything though.
My question here
1. Does hash_map offer just a data structure where the value/element
is stored against a key and the user/developer has to write the hash
function to generate the keys and store them using the above class.
2. Does it also help with collision handling?
If the answer is no for above questions, then what about these?
1. Do I need to write the hash function for the element that I gives
me the key where I can store the element?
2. Secondly how does hash_map internally store the data? Does it use
arrays or linked lists or something else?
Thanks,
-Bharath
I recently used the hash_map class to create a dictionary of some
data. The template class takes the key, value, the class which
performs the compare function and a custom allocator and so on.
I have read about hashing (years ago in college), never implemented
anything though.
My question here
1. Does hash_map offer just a data structure where the value/element
is stored against a key and the user/developer has to write the hash
function to generate the keys and store them using the above class.
2. Does it also help with collision handling?
If the answer is no for above questions, then what about these?
1. Do I need to write the hash function for the element that I gives
me the key where I can store the element?
2. Secondly how does hash_map internally store the data? Does it use
arrays or linked lists or something else?
Thanks,
-Bharath