Sequence containers
You can see the sequence container as βbuilt from scratchβ containers. They use different structures for storing data and have a different algorithm time for inserting, deleting and retrieving an element.
You can find a lot of information about algorithmic container time here.
Container Adapters
Container adapters are behaviors added across sequence containers , making them respect different paradigms. Added behavior can be more strict (stacks will only allow you to click / click on it, without accidentally pasting). They are other types of containers that do not require new storage behavior, and then existing ones. For example, a stack can be built over a vector. Then it will use the vector data structure, but it hinders the use of a certain set of functions that mimic the stack.
The most important thing in all of this is to make sure that you use the right container to meet your needs. A more rigorous container will help you prevent the omission of your data and find out how using your data will help you choose a good container to get better results.
More information on container adapters can be found here.
What should be used most of the time?
Many experts (Scott Meyer, Bjarne Stroustrup) suggest using vector by default, while others (like Herb Sutter, as Steve Jessop pointed out) suggest deque . I would strongly suggest that you choose the container that best suits your needs.
source share