In this article we will discuss what is a deque and how it works internally.
In this article we will discuss the iterator invalidation with respect to std::vector in C++. What is Iterator Invalidation? An Iterator becomes invalidate when the container it points to changes its shape internally i.e. move elements from one location to another and the initial iterator still points to old invalid location. Iterator invalidation in vector …
We can use vector efficiently by taking care of following points,
In this article we will discuss how set and map are different and what factors we need to keep in mind while choosing right associative container.
In this article we will discuss how to iterate over a container of user defined objects and call a member function on each of the iterating element.
The std::for_each() algorithm allows us to iterate over a given range of elements and perform operations over them.
For User Defined classes if Copy Constructor and Assignment Operator are public then only one can insert it’s object in std::vector.
std::vector allocates a memory on heap and store all its elements in contiguous memory location.
Vector is a template based container that behaves just like a Dynamic Array.
Suppose we have a vector of integers and we want to delete all occurences of a number from it i.e.