The unordered map of the C++ standard std::unordered_map
is a hashtable data structure, which means it has a constant access time complexity O(1).
But how is the hashcode calculated to give a unique key index to access a member of the table (moreover given an entry that can be of any type) ? I guess the calculation itself might be complex (like MD5) to avoid collisions ?
In that case, is the algorithm still fast enough to consider it negligible while manipulating std::unordered_map
?
EDIT: I wrote std::map instead of std::unordered_map, this is fixed now