I need to insert 10-million strings into a C++ STL set. The strings are sorted. Will I have a pathological problem if I insert the strings in sorted order? Should I randomize first? Or will the G++ STL implementation automatically rebalance for me?
Share
The only question I have: do you really need a
set?If the data is already sorted and you don’t need to insert / delete elements after the creation, a
dequewould be better:On
binary_search: I suspect you need more than aForwardIteratorfor a binary search, guess this site is off again 🙁