Containers in C++ STL
Sequence containers
Sequence containers implement data structures which can be accessed sequentially.
- array: Static contiguous array (class template)
- vector: Dynamic contiguous array (class template)
- deque: Double-ended queue (class template)
- forward_list: Singly-linked list (class template)
- list : Doubly-linked list (class template)
Associative containers
Associative containers implement sorted data structures that can be quickly searched (O(log n) complexity).
- Set: Collection of unique keys, sorted by keys
(class template) - Map: Collection of key-value pairs, sorted by keys, keys are unique (class template).
- multiset: Collection of keys, sorted by keys (class template)
- multimap: Collection of key-value pairs, sorted by keys
(class template)
Unordered associative containers
Unordered associative containers implement unsorted (hashed) data structures that can be quickly searched (O(1) amortized, O(n) worst-case complexity).
- unordered_set: Collection of unique keys, hashed by keys. (class template)
- unordered_map: Collection of key-value pairs, hashed by keys, keys are unique. (class template)
- unordered_multiset: Collection of keys, hashed by keys (class template)
- unordered_multimap: Collection of key-value pairs, hashed by keys (class template)
Container adaptors
Container adaptors provide a different interface for sequential containers.
- stack: Adapts a container to provide stack (LIFO data structure) (class template).
- queue: Adapts a container to provide queue (FIFO data structure) (class template).
- priority_queue: Adapts a container to provide priority queue (class template).
More Useful Links
- Recent Articles on C++ STL
- Recent Articles on C++ STL
- Coding Practice Platform
- Multiple Choice Questions
- All articles in C++ Category
Recommended Posts:
- Sequence vs Associative containers in C++
- Swapping of subranges from different containers in C++
- C++ program to print all Even and Odd numbers from 1 to N
- Reverse the content of a file and store it in another
- Minimum cells to be flipped to get a 2*2 submatrix with equal elements
- Nested Loops in C++ with Examples
- _Find_first() function in C++ bitset with Examples
- _Find_next() function in C++ bitset with Examples
- Left-Right traversal of all the levels of N-ary tree
- Difference between Iterators and Pointers in C/C++ with Examples
- ostream::seekp(pos) method in C++ with Exmaples
- Default Methods in C++ with Examples
- C++ Tutorial
- Hello World Program : First program while learning Programming
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

