Enjoyment of both worlds: vector insert / erase list efficiency

I need a container that gives me a quick indexer, and can also be very effective with any insert and delete actions (which means at any position of the container).

I remember reading about a container that uses buckets, but I can’t find it or repeat the steps that lead me to it (I will start using bookmarks, I promise!)

Thank you.

+3
source share
3 answers

Perhaps you are looking for some kind of hash map, for example boost::unordered_map(soon it will be in the C ++ standard). There are many other hash implementations.

+4
source

std:: deque, std:: list ( ) , , . "" . , - , .

+1

, , map < > ( ).

-. -, .

I still want me to be able to find an efficient vector / list hybrid that is O (1) in random access and at least O (log N) in erase / insert.

0
source

Source: https://habr.com/ru/post/1757737/


All Articles