According to: This Tutorial
I can't understand the difference between std::map
and std::unorderedmap
. When and Why we should use Map and Unorderedmap?
According to: This Tutorial
I can't understand the difference between std::map
and std::unorderedmap
. When and Why we should use Map and Unorderedmap?
As I've read in tutorial you provided, search speed in std::unorderedmap
is O(1)
. While in std::map
it's O(log2(n))
, where n
is size of the map.
So if you have to call std::find
often, you can consider this option. While choosing hash function isn't an easy task.