Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/condy0919/algo
Algorithms for dsa course
https://github.com/condy0919/algo
algorithm data-structure
Last synced: 15 days ago
JSON representation
Algorithms for dsa course
- Host: GitHub
- URL: https://github.com/condy0919/algo
- Owner: condy0919
- License: mit
- Created: 2020-03-20T09:38:48.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-13T15:50:34.000Z (almost 5 years ago)
- Last Synced: 2024-11-28T19:35:53.035Z (2 months ago)
- Topics: algorithm, data-structure
- Language: C++
- Size: 24.4 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status][github-ci-badge]][github-link]
[![MIT License][license-badge]](LICENSE)
[![Language][language-badge]][language-link]# algo
Algorithms for dsa course.
## Vector
Optimized `vector` for `push_back()` and `emplace_back()` operations.
# Benchmark
Run
``` shell
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARK=On
cmake --build build
```to build all benchmarks.
## `algo::Vector` vs `std::vector`
Run
``` shell
./build/benchmark/vector_benchmark
```to get the result.
| Operation | `std::vector` (ns) | `algo::Vector` (ns) |
|------------------------------|-------------------:|--------------------:|
| **push_back** trivial | 7.64 | 1.93 |
| **emplace_back** non-trivial | 72.8 | 81.2 |
| insert_front trivial | 6056 | 8177 |
| insert_front non-trivial | 76253 | 78311 |
| insert_back trivial | 6.52 | 5.60 |
| insert_back non-trivial | 71.3 | 73.5 |[github-link]: https://github.com/condy0919/algo
[github-ci-badge]: https://github.com/condy0919/algo/workflows/CI/badge.svg
[language-link]: https://en.cppreference.com/w/cpp/compiler_support
[language-badge]: https://img.shields.io/badge/Language-C%2B%2B17-blue.svg
[license-badge]: https://img.shields.io/badge/license-MIT-007EC7.svg