So I think we can assume that it has to do with the insertion order, but I'm not too sure about the exact rule. For example, running this in G++17 with its evil primes shows very different behavior, where using the second to last element is as fast as using the very last element ...
You need to keep count of some data (Example – strings) and no ordering is required. You need single element access i.e. no traversal. Benefits of Unordered_map in C++ The unordered_map has the ability to store data in the form of key-value pairs. Theinsertion,deletion, and theupdatio...
We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {...