https://github.com/paulvondaniels/dynamic_array
Dynamic array in C++ — native std::vector. Supports everything from adding items to sorting and reversing. Ideal for those who want to understand how it works under the hood.
https://github.com/paulvondaniels/dynamic_array
cpp dynamic-vector oop-in-cpp vector
Last synced: 3 months ago
JSON representation
Dynamic array in C++ — native std::vector. Supports everything from adding items to sorting and reversing. Ideal for those who want to understand how it works under the hood.
- Host: GitHub
- URL: https://github.com/paulvondaniels/dynamic_array
- Owner: PaulVonDaniels
- Created: 2025-01-27T14:14:16.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-03-03T19:15:49.000Z (4 months ago)
- Last Synced: 2025-03-23T20:44:50.761Z (3 months ago)
- Topics: cpp, dynamic-vector, oop-in-cpp, vector
- Language: C++
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dynamic array in C++
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.
----------------------------------------------------------------------------------------------------# Dynamic array features
My dynamic array supports the following functions:
1. **Creation**:
You can create an empty dynamic array with an initial length of 0 and a capacity of 8.2. **Adding elements**:
A dynamic array allows you to add values to the end and to the beginning of the array.3. **Deleting elements**:
You can delete the last or first element of the array.4. **Changing and reading values**:
Accessing array elements allows you to change values by index and read them.5. **Insertion and deletion by index**:
The array supports the ability to insert an element at a given index and delete an element by index.6. **Getting information about the array**:
You can get information about the current capacity and length of the array.7. **Copying and merging arrays**:
It is possible to copy arrays, as well as combine two arrays into a new one.8. **Checking for emptiness and clearing**:
You can check if the array is empty and, if necessary, remove all elements from it.9. **Iterating through elements**:
Access to array elements is implemented for their iteration and output.10. **Sorting**:
The array supports sorting of elements.11. **Element Search**:
You can find the index of the first occurrence of a certain value in the array.12. **Array reversal**:
The array can be reversed by changing the order of the elements.13. **Duplicate Removal**:
The array supports the removal of duplicate elements, leaving only unique values.14. **Capacity change**:
You can reduce the capacity of the array to its current size or increase it to the specified value.15. **Filling the array**:
The array can be filled with a specified value for a certain number of elements.16. **Deleting a range of elements**:
You can delete elements from the array in the specified index range.17. **Data exchange with another array**:
The array supports content exchange with another array of the same type.18. **Iterators**:
Implemented iterators for convenient iteration of array elements.