Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivzeng/dynamic_array
A c++ implementation of dynamic-sized array
https://github.com/ivzeng/dynamic_array
Last synced: 7 days ago
JSON representation
A c++ implementation of dynamic-sized array
- Host: GitHub
- URL: https://github.com/ivzeng/dynamic_array
- Owner: ivzeng
- Created: 2022-10-11T17:46:27.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-11T18:05:12.000Z (about 2 years ago)
- Last Synced: 2023-10-01T00:21:37.240Z (over 1 year ago)
- Language: C++
- Size: 85.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dynamic_array
A c++ implementation of dynamic-sized array. ./main would produce the excutation time tests for the DynamicArray structure and the std::vector.# a simple example
```
DynamicArray da{}; // creates a integer DynamicArray, da, of initial capacity 5
da = DynamicArray{10}; // sets da to a DynamicArray of initial capacity 10
for (int i = 1; i <= 20; i += 1)
da.push_back(i); // pushes integers from 1 to 20 into da
da[0] = -1; // sets the first element of da to -1
da[0] += 1; // increments the first element of da by 1
da.print() // print the array, elements separated by two spaces
```