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
C++
4.3K+ articles
C++ Programs
2.4K+ articles
C Language
1.8K+ articles
STL
1.3K+ articles
cpp-vector
375+ articles
cpp-array
173+ articles
cpp-string
157+ articles
CPP Examples
714+ posts
Recent Articles
Popular Articles
C++ Program to Implement Binary Heap
Last Updated: 16 July 2024
A binary heap is a complete binary tree that satisfies the heap property. The heap property states that for a max-heap, every parent node has a value greater than or equal...
read more
C++
Picked
CPP Examples
CPP-DSA
B-Tree Implementation in C++
Last Updated: 15 July 2024
In C++, B-trees are balanced tree data structures that maintain sorted data and allow searches, sequential access, insertions, and deletions in logarithmic time. B-trees a...
read more
C++
Picked
CPP Examples
CPP-DSA
How to Get the MD5 Hash of a File in C++?
Last Updated: 21 August 2024
In cryptography, we use the MD5 (Message Digest Algorithm 5) hash function for creating a 128-bit hash value which is represented as a 32-character hexadecimal number. How...
read more
C++ Programs
C++
Picked
CPP Examples
How to Iterate Through a Vector in C++?
Last Updated: 15 November 2024
Iterating or traversing a vector means accessing each element of the vector sequentially. In this article, we will learn different methods to iterate over a vector in C++....
read more
C++ Programs
C++
cpp-iterator
STL
cpp-vector
CPP Examples
How to Add Elements in a Vector in C++?
Last Updated: 26 November 2024
In C++, vector provides several built-in methods to insert the elements and efficiency of the insertion depends on the position where the insertion takes place. In this ar...
read more
C++ Programs
C++
STL
cpp-vector
CPP Examples
Find Column and Row Size of a 2D Vector in C++
Last Updated: 17 February 2025
In C++, 2D vector is the vector in which each element is a vector in itself. The number of these vectors represent the column size, and the size of each vector represents ...
read more
C++ Programs
C++
STL
cpp-vector
CPP Examples
How to Delete All Elements from a Vector in C++?
Last Updated: 25 November 2024
In C++, you can delete all items from a vector to either clear its contents or free its memory. In this article, we will learn how to delete all items from a vector in C++...
read more
C++ Programs
C++
STL
cpp-vector
CPP Examples
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
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
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
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
...
48
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 !