The fastest way to speed up the map display is <string, int> .find () in C ++. Where keys are in alphabetical order
I have a card with approximately 100,000 pairs. Is there a way to speed up the search when using find () if the keys are in alphabetical order. Just like I should do it. I know that when creating a map you can specify a new comparator. But will this speed up the find () function?
Thanks in advance.
[resolved] Thanks to the guys in the group, I decided to go with the vector and use the bottom and top to “crop” some of the searches.
I'm also new here, is there a way to mark this question in response or choose the best answer?
+5
4 answers
unordered_map, .
, , . , , . , , .
Going Native 2012 Bjarne Stroustroup , . vector list , , , list , - vector . , 43.
unordered_map , , , , vector (, , , vector), ,
+2