Course Data Structures Essentials
Dynamic Vector
Hello again ๐. In this class you will learn about Dynamic Vector and its main functions.
- Introduction to Dynamic Vector
- Dynamic Vector in C++
- Dynamic Vector in Python
Introduction
Imagine a situation where we need to use a vector-type structure, but we don't know the size of the input or whether new elements will be inserted later during the execution of a program. For this type of situation, there is a data structure that implements a vector, but it is possible to expand its size according to the programmer's needs.
The Dynamic Vector is a variable size data structure that starts with a constant size

Figure 1 : Insertion of element 5 at the end of the dynamic vector
Note that even having
std::vector
The std::vector is the implementation of the Dynamic Vector in C++. In the C++ implementation whenever the capacity is exceeded the vector doubles in size