Set in STL Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value of the element cannot be modified once it is added to the set, though it is possible to remove and add the modified value of that element.
Vector in STL Vector is same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled automatically by the container. Vector elements are placed in contiguous storage so that they can be accessed and traversed using iterators.
Set of Vectors in STL: Set of Vectors can be very efficient in designing complex data structures.
For example: Consider a simple problem where we have to print all the unique vectors.
Set of Vectors: 1 3 5 7 9 11 13 5 10 15 10 20 30 40
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Vector of Vectors in C++ STL with Examples
- Priority Queue of Vectors in C++ STL with Examples
- Working with Array and Vectors using STL in C++
- How to join two Vectors using STL in C++?
- Array of Vectors in C++ STL
- Program for dot product and cross product of two vectors
- How to flatten a Vector of Vectors or 2D Vector in C++
- Implementation of file allocation methods using vectors
- Left rotation of an array using vectors in C++
- set::rbegin() and set::rend() in C++ STL
- set::begin() and set::end() in C++ STL
- Stack of Pair in C++ STL with Examples
- Queue of Pairs in C++ STL with Examples
- Counting Inversions using Set in C++ STL
- set::swap() in C++ STL
- set::size() in C++ STL
- set::empty() in C++ STL
- set::erase in C++ STL
- set::emplace() in C++ STL
- set::clear in C++ STL
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.