|
DSA - Data Structures and Algorithms
|
An educational project focused on reimplementing selected data structures and algorithms from C++ Standard Template Library using C++20. The primary goal is to gain deeper understanding of STL design decisions, implementation trade-offs, and their impact on usability.
The following containers are implemented with an STL-like interface, including iterators and compatibility with standard algorithms where applicable.
This template intentionally does not implement a bit-packed specialization for bool, as found in std::vector<bool>. The standard container's specialization breaks reference semantics and replaces bool& with proxy objects. dsa::Vector<bool> behaves like a regular container, without bit-packing. This design choice prioritizes correctness and predictable semantics over memory optimization.
Adding CMake configuration options can be used to disable features that are not available on the local machine and suppress related warnings. The CMakeLists.txt file contains a list of supported flags. For example, passing -DDOCS_ENABLED=OFF flag during the initial CMake configuration disables documentation generation if the required tools are not available.
Execute the following commands inside project repository to build and run tests on your local system:
Additional CMake configuration flags can be passed during the initial configuration step to disable optional features if they are not available on your local system.
Unit tests compare output of various operations on implemented containers with output from STL containers.
The project is checked using clang-tidy in GitHub Actions CI workflow.
The runner image and tool versions are set explicitly in CI where possible. Local execution of clang-tidy with different compilers or tools may yield different results.
clang-tidy is run per translation unit, so header-only libraries may be analysed multiple times in unit tests. Because clang-tidy checks can take long time, CI jobs are run only on pull requests, after unit tests have passed successfully.
The configuration is based on the .clang-tidy file in the project root directory.
In CI, clang-tidy runs in strict mode, threating all warnings as errors. The build will fail immediately if any issue is detected. Locally, clang-tidy can be enabled without failing the build, unless the strict mode flag is manually set.
Copyright (c) 2025 Michal Zygmunt
The project is distributed under the MIT License.
Michal Zygmunt