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?
Usually the time complexity is specified for operations. In your case the lookup and insert seems relevant.
See http://www.sgi.com/tech/stl/complexity.html for the guaranteed complexties of the STL containers. And this http://www.sgi.com/tech/stl/AssociativeContainer.html on the Associative Containers.
Another source is found here:
the lookup of std::map is log(number of elements in the map).