set of vectors c++
C++
// C++ program to demonstrate
// use of set for vectors
#include <bits/stdc++.h>
using namespace std;
set<vector<int> > set_of_vectors;
// Print elements of Vector
void Print_Vector(vector<int> Vec)
{
for (int i = 0; i < Vec.size(); i++) {
cout << Vec[i] << " ";
}
cout << endl;
return;
}
// Driver code
int main()
{
// Initializing some vectors
vector<int> data_1{ 10, 20, 30, 40 };
vector<int> data_2{ 5, 10, 15 };
vector<int> data_3{ 1, 3, 5, 7, 9, 11, 13 };
vector<int> data_4{ 5, 10, 15 };
vector<int> data_5{ 10, 20, 30, 40 };
// Inserting vectors into set
set_of_vectors.insert(data_1);
set_of_vectors.insert(data_2);
set_of_vectors.insert(data_3);
set_of_vectors.insert(data_4);
set_of_vectors.insert(data_5);
// printing all the unique vectors in set
cout << "Set of Vectors: \n";
for (auto it = set_of_vectors.begin();
it != set_of_vectors.end();
it++) {
Print_Vector(*it);
}
return 0;
}
Also in C++:
- Title
- decimal to hex cpp
- Category
- C++
- Title
- Find a element in a map C++
- Category
- C++
- Title
- sieve of eratosthenes c++
- Category
- C++
- Title
- inserting an element in an set c++
- Category
- C++
- Title
- program to know if a number is prime
- Category
- C++
- Title
- translate
- Category
- C++
- Title
- make an x using asterisk c++
- Category
- C++
- Title
- error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(s[i] != "b"){
- Category
- C++
- Title
- find vector in c++
- Category
- C++
- Title
- sub string of vector c++
- Category
- C++
- Title
- 2927260.eps 2927262.jpg 2927263.ai License free.txt License premium.txt
- Category
- C++
- Title
- c++ code to print hello world
- Category
- C++
- Title
- user input c++
- Category
- C++
- Title
- initialize map c++
- Category
- C++
- Title
- convert GLFWwindow* to IntPtr
- Category
- C++
- Title
- string to vector c++
- Category
- C++
- Title
- create new file c++
- Category
- C++
- Title
- select elements from array C++
- Category
- C++
- Title
- apple and orange hackerrank solution in c++
- Category
- C++
- Title
- binary tree search
- Category
- C++
- Title
- zeros of array c++
- Category
- C++
- Title
- how to compare lower case character to uppercase cpp
- Category
- C++
- Title
- range of int
- Category
- C++
- Title
- ue4 c++ overlapping functions cpp setup
- Category
- C++
- Title
- getline in c++
- Category
- C++
- Title
- coronavirus
- Category
- C++
- Title
- is x prime?
- Category
- C++
- Title
- substitution failure is not an error
- Category
- C++
- Title
- euler phi gfg
- Category
- C++
- Title
- sort function in cpp
- Category
- C++
- Title
- sort a pair using c++ stl
- Category
- C++
- Title
- eratosthenis sieve in c++
- Category
- C++
- Title
- c++ formatting
- Category
- C++
- Title
- c++ overload operator
- Category
- C++
- Title
- prims c++
- Category
- C++
- Title
- 2d vector
- Category
- C++
- Title
- maximum subarray sum in c++
- Category
- C++
- Title
- initialize int c++
- Category
- C++
- Title
- add a timer c++
- Category
- C++
- Title
- how to output to console c++
- Category
- C++
- Title
- Rectangle area hackerrank solution in c++
- Category
- C++
- Title
- COnvert string to char * C++
- Category
- C++
- Title
- system("pause") note working c++
- Category
- C++
- Title
- pairs in c++
- Category
- C++
- Title
- c++ tutorial
- Category
- C++
- Title
- phph date
- Category
- C++
- Title
- array<string, 7> c++
- Category
- C++
- Title
- c++ try
- Category
- C++
- Title
- error: invalid conversion from 'Node*' to 'int'
- Category
- C++
- Title
- hashset in c++
- Category
- C++
- Title
- c++ get last element in vector
- Category
- C++
- Title
- c++ excel cell blank cells
- Category
- C++
- Title
- c++ show time elapsed
- Category
- C++
- Title
- Combination Sum
- Category
- C++
- Title
- empty string c++ value
- Category
- C++
- Title
- what does count function do in hashmap
- Category
- C++
- Title
- jump to case label c++
- Category
- C++
- Title
- coping 2d vector in cpp
- Category
- C++
- Title
- find height of a tree
- Category
- C++
- Title
- c++ while true
- Category
- C++
- Title
- length of string in c++
- Category
- C++
- Title
- how the theam are store in database
- Category
- C++
- Title
- gcd in c++
- Category
- C++
- Title
- E/flutter (20384): [ERROR:flutter/third_party/txt/src/minikin/FontFamily.cpp(184)] Could not get cmap table size! E/flutter (20384): F/flutter (20384): [FATAL:flutter/third_party/txt/src/minikin/FontCollection.cpp(95)] nTypefaces == 0
- Category
- C++
- Title
- c++ program to find gcd of 3 numbers
- Category
- C++
- Title
- how to print for limited decimal values in c++
- Category
- C++
- Title
- how to pass an object by reference in c++
- Category
- C++
- Title
- sort function in c++
- Category
- C++
- Title
- how to iterate through array in c++
- Category
- C++
- Title
- c++ string to stream
- Category
- C++
- Title
- new class * [] c++
- Category
- C++
- Title
- free or delete in c++
- Category
- C++
- Title
- flushing output in c++
- Category
- C++
- Title
- iterar un map c++
- Category
- C++
- Title
- c++ loop through array
- Category
- C++
- Title
- set of vectors c++
- Category
- C++
- Title
- min heap priority queue c++
- Category
- C++
- Title
- c++ ternary operator
- Category
- C++
- Title
- binary search stl in c++
- Category
- C++
- Title
- matrix class in c++
- Category
- C++
- Title
- can we compare a long long int with int in c++ using max or min functions
- Category
- C++
- Title
- binary tree deletion
- Category
- C++
- Title
- screen record ios simulator
- Category
- C++
- Title
- random number generator c++
- Category
- C++
- Title
- sum of two numbers c++
- Category
- C++
- Title
- queue stl c++
- Category
- C++
- Title
- maximum possible number atmost k swaps
- Category
- C++
- Title
- how to make a 2d vector in c++
- Category
- C++
- Title
- constant variables in c++
- Category
- C++
- Title
- comparing strings c++
- Category
- C++
- Title
- how to find the number of cycles in a graph C++
- Category
- C++
- Title
- how to get a letter from the user c++ string
- Category
- C++
- Title
- c++ function to find length of array
- Category
- C++
- Title
- c++ convert const char* to LPCWSTR
- Category
- C++
- Title
- c++ throw exception
- Category
- C++
- Title
- C++ Syntax
- Category
- C++
- Title
- pop_back
- Category
- C++
- Title
- c++ std::copy to cout
- Category
- C++
- Title
- calling by reference c++
- Category
- C++
- Title
- what is difference between ciel and floor
- Category
- C++