Assume I wanted to map data that had a string as the key.
Should I have used map or unordered map as my container?
Because unordered map consumes more memory, let's pretend memory isn't a problem and the only concern is performance.
The average complexity of unordered map should be O(1), with the worst case being O(2) (n).
In what circumstances would it reach O(n)?
When does a map become faster than unordered map?
Is this true when n is small?
Assuming I use STL unordered map with the default haser Vs. map, the key is string.
Should I use map if I'm going to loop through the items rather than accessing an individual element each time?