3 ms·
The C++ STL's map (the associative array) is idiosyncratic in one important respect: while most associative arrays, like Perl and Ruby hash tables, C# dictionar
by philwelch 17y ago
The C++ STL's map (the associative array) is idiosyncratic in one important respect: while most associative arrays, like Perl and Ruby hash tables, C# dictionaries, and Java HashMaps are hash tables with O(1) performance, the C++ map is in fact sorted by key, yielding O(log n) performance. Unless you need your keys sorted for whatever reason I wouldn't recommend the STL map.