Unordered map

The unordered map doesn’t sort the items alphanumerically and uses a hash table. That means its operations have the same big-O as those of a hash table. You use it in the same way as a map, but you need to include

#include <unordered_map>

instead of

#include <map>

as well as

using namepace std::tr1;

If you use a map that stores some self-defined class, you need to write your own hash function.