C++ Containers

 

C++ Containers

 

As discussed earlier, containers are objects that store information and they are nothing but class templates with specific functionalities. Containers themselves are of three types: 

 

Sequence Containers

A sequence container stores that data in a linear fashion. Sequence containers include Vector, List, Dequeue, etc. These are some of the most used sequence containers.

 

Associative Containers

An associative container is designed in such a way that enhances the accessing of some element in that container. It is very much used when the user wants to fastly reach some element. Some of these containers are, Set, Multiset, Map, Multimap etc. They store their data in a tree-like structure.

 

Derived Containers

As the name suggests, these containers are derived from either the sequence or the associative containers. They often provide you with some better methods to deal with your data. They deal with real life modeling. Some examples of derived containers are Stack, Queue, Priority Queue, etc.