Apropiated std container for (only) insertion and iteration
Which will be the std container to use if I only want to insert a lot of
items and then iterate over all of them (order is not important)?
I have noticed that both unsorted_set and forward_list have O(1) for
insertion and O(n) for iteration. Is there any other which also has that
complexity? Which one of those is the fastest? (if there is significant
differences in memory use i will also be interested in knowing about them.
(I'm only interested in std containers, not Boost or other libraries ones)
No comments:
Post a Comment