mardi 5 mai 2020

What is the complexity for inserting, find & retrieving a list of string and int into a map & unordered_map of c++11?

I would like to map a list of string corresponding to a string key. and similarly a list of int to a key int value in c++. For example:

map<int, list<int> >mappedIntList;
map<string, list<string> >mappedStringList;
unordered_map<int, list<int> >hashmapIntList;
unordered_map<string, list<string> >hashmapStringList;

What is the worse-case complexity to insert, find, [] methods for both map and unordered_map in CPP ?

Aucun commentaire:

Enregistrer un commentaire