This project is an implementation of a dynamic array (analogous to std::vector
) in C++.
A dynamic array allows efficient memory management and provides convenient methods for working with elements.
My dynamic array supports the following functions:
-
Creation:
You can create an empty dynamic array with an initial length of 0 and a capacity of 8. -
Adding elements:
A dynamic array allows you to add values to the end and to the beginning of the array. -
Deleting elements: You can delete the last or first element of the array.
-
Changing and reading values: Accessing array elements allows you to change values by index and read them.
-
Insertion and deletion by index: The array supports the ability to insert an element at a given index and delete an element by index.
-
Getting information about the array: You can get information about the current capacity and length of the array.
-
Copying and merging arrays:
It is possible to copy arrays, as well as combine two arrays into a new one. -
Checking for emptiness and clearing: You can check if the array is empty and, if necessary, remove all elements from it.
-
Iterating through elements: Access to array elements is implemented for their iteration and output.
-
Sorting: The array supports sorting of elements.
-
Element Search: You can find the index of the first occurrence of a certain value in the array.
-
Array reversal: The array can be reversed by changing the order of the elements.
-
Duplicate Removal: The array supports the removal of duplicate elements, leaving only unique values.
-
Capacity change: You can reduce the capacity of the array to its current size or increase it to the specified value.
-
Filling the array: The array can be filled with a specified value for a certain number of elements.
-
Deleting a range of elements: You can delete elements from the array in the specified index range.
-
Data exchange with another array:
The array supports content exchange with another array of the same type. -
Iterators: Implemented iterators for convenient iteration of array elements.