How C++ std::map works internally ?

Revision en1, by rating_dont_even_matter, 2017-09-18 14:06:45

Does anyone know how C++ STL map works internally for keys like string? I tried googling, but didn't find much. Does it hash the string for matching or does it match character by character?

30441799 In this code of problem D of last contest (434), he used a map with string as key, it got TLE.

30461043 In this code, he just turned the map into unordered_map, and AC with 2276ms.

Why map and unordered_map differs that much ?

Tags c++, unordered_map, map, stl, c++ 11, c++ 14, hash

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English rating_dont_even_matter 2017-09-18 14:06:45 507 Initial revision (published)