Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
C++
4k+ articles
C++ Programs
2.5k+ articles
Sorting
1.7k+ articles
STL
1.2k+ articles
CPP Examples
700+ articles
cpp-containers-library
92 articles
cpp-pair
76 articles
cpp-vector
360+ posts
Popular Articles
Recent Articles
8 Ways to Initialize Vector in C++
Last Updated: 06 November 2024
Initializing a vector means assigning some initial values to the std::vector elements. In this article, we will learn 8 different ways to in
...read more
STL
cpp-vector
C++
How to Find Index of a Given Element in a Vector in C++?
Last Updated: 26 November 2024
Vectors stores elements in contiguous memory and these elements can be accessed by their indexes. In this article, we will learn the reverse
...read more
STL
cpp-vector
C++
C++ Programs
CPP Examples
Sorting a Map by value in C++ STL
Last Updated: 29 December 2022
Maps are associative containers that store elements in a mapped fashion. Each element has a key value and a mapped value. No two mapped valu
...read more
Sorting
Hash
cpp-vector
C++ Programs
cpp-map
cpp-pair
DSA
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
C++
4k+ articles
C++ Programs
2.5k+ articles
Sorting
1.7k+ articles
STL
1.2k+ articles
CPP Examples
700+ articles
cpp-containers-library
92+ articles
cpp-pair
76+ articles
Vector of Vectors in C++ STL with Examples
Last Updated: 14 February 2020
Prerequisite: Vectors in C++ STLVectors are known as dynamic arrays with the ability to resize itself automatically when an element is inser
...read more
Misc
cpp-vector
C++
How to Find the Maximum Element of a Vector using STL in C++?
Last Updated: 02 November 2024
Given a vector, find the maximum element of the vector using STL in C++. ExampleInput: v = {2, 4, 1, 5, 3}Output: 5Explanation: 5 is the lar
...read more
STL
cpp-vector
C++
C++ Programs
CPP Examples
Sorting a Vector in C++
Last Updated: 13 December 2024
Sorting a vector means arranging the elements of vector in ascending order or in descending order or in desired defined order. In this artic
...read more
STL
cpp-vector
C++
C++ Programs
Vector insert() in C++ STL
Last Updated: 11 January 2025
In C++, the vector insert() is a built-in function used to insert new elements at the given position in a vector. In this article, we will l
...read more
STL
CPP-Functions
cpp-vector
C++
cpp-containers-library
Vector erase() in C++ STL
Last Updated: 16 January 2025
In C++, vector erase() is a built-in function used to remove one or more elements from a vector present at a specific position or within a s
...read more
STL
CPP-Library
CPP-Functions
cpp-vector
cpp-advanced
C++
Vector push_back() in C++ STL
Last Updated: 27 December 2024
In C++, the vector push_back() is a built-in method used to add a new element at the end of the vector. It automatically resizes the vector
...read more
STL
CPP-Library
CPP-Functions
cpp-vector
C++
2D Vector in C++
Last Updated: 11 January 2025
A 2D vector is a vector of the vector i.e. each element is a vector in itself. It can be visualised as a matrix where each inner vector repr
...read more
STL
cpp-vector
C++
Passing Vector to a Function in C++
Last Updated: 11 November 2024
To perform operations on vector belonging to one function inside other function, we pass this vector to the function as arguments during the
...read more
STL
CPP-Functions
cpp-vector
C++
Array of Strings in C++
Last Updated: 26 February 2025
In C++, a string is sequence of characters that is used to store textual information. Internally, it is implemented as a dynamic array of ch
...read more
cpp-string
cpp-array
cpp-vector
C++
CPP Array and String
Different Ways to Copy a Vector in C++
Last Updated: 20 November 2024
Copying a vector is the process of creating a new vector that contains same elements as original vector. In this article, we will learn diff
...read more
STL
cpp-vector
C++
C++ Programs
CPP Examples
Sort Vector of Pairs in Ascending Order in C++
Last Updated: 17 December 2024
Sorting a vector of pairs in ascending order means arranging the elements in such a way that first pair is lesser than second pair, second p
...read more
Sorting
STL
CPP-Library
cpp-vector
C Language
C++
C++ Programs
DSA
CPP Examples
Vector in C++ STL
Last Updated: 04 March 2025
In C++, vector is a dynamic array that stores collection of elements same type in contiguous memory. It has the ability to resize itself aut
...read more
STL
cpp-vector
C++
cpp-containers-library
1
2
3
4
5
6
7
8
>>
Last
1
2
3
4
5
6
>>
Last
1
2
3
4
>>
Last
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 !