Unlike normal C/C++ arrays, we don’t need to do element by element comparison to find if two given vectors contain same elements or not.
In case of vectors, the operator “==” is overloaded to find the result quickly. Below is an example to demonstrate same.
Equal Not Equal Not Equal Equal
This article is contributed by Sachin Bisht. 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 write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
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.
- Quickly merging two sorted arrays using std::merge() in C++ STL
- How to join two Vectors using STL in C++?
- Working with Array and Vectors using STL in C++
- Map of Vectors in C++ STL with Examples
- Array of Vectors in C++ STL
- Program to check if an Array is Palindrome or not using STL in C++
- Elements present in first array and not in second using STL in C++
- Difference between std::remove and vector::erase for vectors
- How to find common elements between two Arrays using STL in C++?
- How to find common elements between two Vector using STL in C++?
- Rearrange characters in a string such that no two adjacent are same
- Counts of distinct consecutive sub-string of length two using C++ STL
- How to join two Arrays using STL in C++?
- Quick way to check if all the characters of a string are same
- Minimum delete operations to make all elements of array same
- Check if Array elements can be maximized upto M by adding all elements from another array
- std::transform() in C++ STL (Perform an operation on all elements)
- How to insert elements in C++ STL List ?
- Delete elements in C++ STL list
- Sorting Array Elements By Frequency | Set 3 (Using STL)