What is the time complexity of std::map? And will it degenerate in the worst case? Or it is decide by the implementation, we can\'t know it?
if you're asking about the lookup time compexity for std::map then that would be O(log(n)) since the stl implemented the std::map library as a Tree (binary tree) datastructure.
More information here: http://www.cplusplus.com/reference/map/map/
Here is also the commonly used std::unordered_map, which would be your hashmap (no ordering hence) with a O(1) look up speed, however, using more memory than the Tree per the design of the data structure.