c++ - Should I randomly shuffle before inserting into STL set? -
I need to insert 10 million strings into a C + + STL set. I string is sorted if I sort order Do I have a disease problem? Should I Make Random First? Or will the implementation of G + STL be reborn automatically for me?
I have only one question: do you really need a set
?
If the data is already sorted and you do not need to insert / delete elements after creation, then a deck
will be better
- You will have only one big-o complexity to retrieve
- You will get less memory overhead ... and better cache terrain
at Binary_search
: I suspect that you need more than ForwardIterator
for a binary search, guess that this site is again Area is closed: (
Comments
Post a Comment