Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Misc
8.8K+ articles
Mathematical
7.8K+ articles
Arrays
6.5K+ articles
C++
4.3K+ articles
C++ Programs
2.4K+ articles
Sorting
1.8K+ articles
STL
1.3K+ articles
cpp-containers-library
93+ articles
cpp-vector
375+ posts
Recent Articles
Popular Articles
Vector back() in C++ STL
Last Updated: 21 November 2024
In C++, the vector back() is a built-in function used to retrieve the last element of the vector. It provides a reference to the last element which allows us to read or mo...
read more
C++
STL
cpp-vector
cpp-containers-library
Vector clear() in C++ STL
Last Updated: 09 April 2025
In C++, vector clear() is a built-in method used to remove all elements from a vector, making it empty. In this article, we will learn about the vector clear() method in C...
read more
C++
STL
cpp-vector
cpp-containers-library
CPP Examples
How to Initialize 2D Vector in C++?
Last Updated: 22 November 2024
Initializing a 2D vector refers to the process of assigning initial values to the elements of a 2D vector. In this article, we will learn different methods to initialize a...
read more
C++ Programs
C++
STL
cpp-vector
CPP Examples
How to Insert Elements into 2D Vector in C++?
Last Updated: 22 November 2024
In C++, 2D vectors provide several built-in methods to insert elements. The efficiency of the insertion depends on where the insertion occurs. In this article, we will exp...
read more
C++ Programs
C++
STL
cpp-vector
CPP Examples
How to Iterate 2D Vector in C++?
Last Updated: 27 May 2025
Iterating or traversing a 2D vector means accessing each element of the 2D vector sequentially. In this article, we will explore different methods to iterate over a 2D vec...
read more
C++ Programs
C++
STL
cpp-vector
CPP Examples
Vector Operator = in C++ STL
Last Updated: 25 November 2024
In C++, the vector operator = is used to assign the contents of one vector to another. It allows you to copy elements from one vector to another or initialize a vector wit...
read more
C++
STL
cpp-vector
cpp-containers-library
How to Find Duplicates in a Vector in C++?
Last Updated: 26 November 2024
In this article, we will learn how to find the duplicate elements in a vector in C++.The easiest way to find the duplicate elements from the vector is by using sort() func...
read more
C++ Programs
C++
STL
cpp-vector
CPP Examples
Right Rotation of Vectors in C++
Last Updated: 05 December 2024
Right rotation of a vector involves shifting all elements to the right by a specified number of positions. The elements shifted out from the right end are wrapped around t...
read more
C++ Programs
C++
STL
cpp-vector
CPP Examples
Vector pop_back() in C++ STL
Last Updated: 26 November 2024
In C++, the vector pop_back() is a built-in method used to remove the last element from a vector. It reduces the size of the vector by one, but the capacity remains unchan...
read more
C++
STL
CPP-Functions
cpp-vector
cpp-containers-library
Vector begin() in C++ STL
Last Updated: 26 November 2024
In C++, the vector begin() is a built-in method used to obtain an iterator pointing to the start of the vector. This iterator is used to traverse the vector or perform ope...
read more
C++
STL
cpp-vector
cpp-containers-library
How to Initialize a Vector with Zero in C++?
Last Updated: 03 December 2024
Initializing a vector with value zero means assigning the initial value 0 to all elements of vector. In this article, we will learn the different methods to initialize the...
read more
C++ Programs
C++
STL
cpp-vector
How to Remove Elements from a Vector while Iterating in C++?
Last Updated: 03 December 2024
Erasing elements from a vector while iterating can be challenging because removing an element may invalidate iterators or change the size of the vector. In this article, w...
read more
C++ Programs
C++
STL
cpp-vector
Initialize a Vector with Hardcoded Elements
Last Updated: 05 December 2024
C++ allows us to initialize the vector with hardcoded (predefined) elements. In this article, we will learn how to initialize the vector with predefined elements.The simpl...
read more
C++ Programs
C++
STL
cpp-vector
CPP Examples
Vector crbegin() in C++ STL
Last Updated: 28 November 2024
In C++, the vector crbegin() is a built-in method used to obtain a constant reverse iterator pointing to the last element of the vector. It is used to mark the starting po...
read more
C++
STL
cpp-vector
cpp-containers-library
How to Insert an Element in a Sorted Vector in C++?
Last Updated: 06 December 2024
In C++, inserting element in a sorted vector should be done such that it preserves the order of elements. In this article, we will learn different methods to insert an ele...
read more
C++ Programs
C++
STL
cpp-vector
CPP Examples
1
2
3
4
...
25
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !