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
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Vector of Vectors in C++ STL with Examples
- Priority Queue of Vectors in C++ STL with Examples
- Array of Vectors in C++ STL
- How to join two Vectors using STL in C++?
- Working with Array and Vectors using STL in C++
- Left rotation of an array using vectors in C++
- Implementation of file allocation methods using vectors
- Program for dot product and cross product of two vectors
- How to flatten a Vector of Vectors or 2D Vector in C++
- std::less in C++ with Examples
- Pi(π) in C++ with Examples
- std::is_heap( ) in C++ with Examples
- std::equal_to in C++ with Examples
- std::greater in C++ with Examples
- std::not_equal_to in C++ with Examples
- std::less_equal in C++ with Examples
- std::greater_equal in C++ with Examples
- std::bit_xor in C++ with Examples
- std::remove_const in C++ with Examples
- Public vs Protected in C++ with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.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.