Give an example of a dynamic array, i.e. a vector. Note: the set or insert method is equivalent to the add method.
Dynamic array or vector is used in place of array as it can be dynamically handled to insert, delete and modify the array. The size of the array can be adjusted accordingly to requirement. To insert element and display the element using vector is shown below in the figure:
Hope it helped.
Get Answers For Free
Most questions answered within 1 hours.