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
- 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++
- Pi(π) in C++ with Examples
- std::less in C++ with Examples
- std::equal_to in C++ with Examples
- std::greater_equal in C++ with Examples
- std::bit_xor in C++ with Examples
- std::greater in C++ with Examples