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?
This depends on the implementation, you can't associate a complexity of any kind to std::map just by looking at the language specs.
Usually an std::map is implemented as a Red-Black Tree and you can find all info about the Big-O properties of this kind of containers here.
Notably there are less popular alternatives to the standard libraries shipped with popular compilers such as msvc or gcc, that implements this kind of containers with B-trees, this leads to lower memory usage due to the fact that a B-tree usually occupy less memory that an RB-tree.
For example click here.