{"id":25852571,"url":"https://github.com/mangad/cppdsa","last_synced_at":"2025-03-01T14:20:10.721Z","repository":{"id":279943746,"uuid":"940222999","full_name":"MangaD/CppDSA","owner":"MangaD","description":"My personal study on Data Structures and Algorithms in C++.","archived":false,"fork":false,"pushed_at":"2025-02-28T15:40:49.000Z","size":196,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T17:17:29.837Z","etag":null,"topics":["algorithms","cmake","conan2","cpp","cpp17","cpp20","data-structures","data-structures-and-algorithms","doxygen","google-benchmark","google-test","gprof","perf","valgrind"],"latest_commit_sha":null,"homepage":"https://mangad.github.io/CppDSA/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MangaD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-27T20:13:09.000Z","updated_at":"2025-02-28T15:44:18.000Z","dependencies_parsed_at":"2025-02-28T17:17:33.564Z","dependency_job_id":"0bacb782-482b-4d08-87df-0a042a7d8caf","html_url":"https://github.com/MangaD/CppDSA","commit_stats":null,"previous_names":["mangad/cppdsa"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MangaD%2FCppDSA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MangaD%2FCppDSA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MangaD%2FCppDSA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MangaD%2FCppDSA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MangaD","download_url":"https://codeload.github.com/MangaD/CppDSA/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241375190,"owners_count":19952672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","cmake","conan2","cpp","cpp17","cpp20","data-structures","data-structures-and-algorithms","doxygen","google-benchmark","google-test","gprof","perf","valgrind"],"created_at":"2025-03-01T14:20:09.940Z","updated_at":"2025-03-01T14:20:10.693Z","avatar_url":"https://github.com/MangaD.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CppDSA\r\n\r\nCppDSA is a deep dive into C++ data structures and algorithms, with a focus on exploring and benchmarking the components of the C++ Standard Library (STL). This project includes implementations, performance benchmarks, unit tests, profiling examples, and in-depth documentation—all built using modern C++20 and managed with CMake and Conan 2.\r\n\r\n## Table of Contents\r\n\r\n- [Overview](#overview)\r\n- [Features](#features)\r\n- [Directory Structure](#directory-structure)\r\n- [Prerequisites](#prerequisites)\r\n- [Installation and Setup](#installation-and-setup)\r\n- [Building the Project](#building-the-project)\r\n- [Running Unit Tests](#running-unit-tests)\r\n- [Running Benchmarks](#running-benchmarks)\r\n- [Generating Documentation](#generating-documentation)\r\n- [Continuous Integration](#continuous-integration)\r\n- [Contributing](#contributing)\r\n- [License](#license)\r\n\r\n## Overview\r\n\r\nCppDSA is dedicated to exploring the intricacies of C++ data structures and algorithms. The project covers:\r\n- **In-depth Documentation:** Detailed markdown guides and Doxygen-generated documentation on STL containers, iterators, algorithms, and advanced topics.\r\n- **Performance Benchmarks:** Microbenchmarks using Google Benchmark to measure operations like insertion, deletion, and sorting across various STL containers.\r\n- **Unit Testing:** A comprehensive suite of tests implemented with GoogleTest.\r\n- **Profiling Examples:** Guidance and integration examples for profiling with tools such as gprof, Valgrind (Callgrind), and perf.\r\n- **Modern C++:** Leveraging C++20 features and best practices.\r\n\r\n## Features\r\n\r\n- **Comprehensive STL Exploration:** Detailed study of containers (e.g., vector, list, deque, map, unordered_map), iterators, and algorithms.\r\n- **Benchmarking and Profiling:** Real-world performance measurement and analysis.\r\n- **Modular Build System:** Configured with CMake and managed via Conan 2.\r\n- **Unit Tests:** Ensuring robustness and correctness of implementations.\r\n- **Documentation:** Both in Markdown and auto-generated via Doxygen.\r\n  \r\n## Directory Structure\r\n\r\n```\r\nCppDSA/\r\n├── cmake/                   # Additional CMake modules (e.g., doxygen configuration)\r\n├── docs/                    # Markdown documentation and Doxygen configuration (Doxyfile)\r\n├── include/                 # Header files\r\n├── src/                     # Source code (benchmarks, data structure implementations, algorithms)\r\n├── tests/                   # Unit tests (GoogleTest)\r\n├── CMakeLists.txt           # Top-level CMake configuration\r\n├── conanfile.txt            # Conan configuration for dependencies\r\n├── CMakePresets.json        # CMake presets (including one for Conan 2)\r\n└── LICENSE                  # Project license\r\n```\r\n\r\n## Prerequisites\r\n\r\n- **Compiler:** A modern C++ compiler with C++20 support (GCC 10+, Clang 10+, or MSVC 2019+)\r\n- **CMake:** Version 3.16 or later\r\n- **Conan 2:** For dependency management\r\n- **Python:** For installing Conan via pip (Python 3.x)\r\n- **Optional Tools:**  \r\n  - Valgrind, gprof, or perf for profiling  \r\n  - Doxygen for generating HTML documentation\r\n\r\n## Installation and Setup\r\n\r\n1. **Clone the Repository:**\r\n   ```bash\r\n   git clone https://github.com/MangaD/CppDSA.git\r\n   cd CppDSA\r\n   ```\r\n\r\n2. **Install Conan 2 (if not already installed):**\r\n   ```bash\r\n   pipx ensurepath\r\n   pipx install conan\r\n   conan profile detect --force\r\n   ```\r\n\r\n3. **Conan Configuration:**\r\n   Your `conanfile.txt` should include:\r\n   ```ini\r\n   [requires]\r\n   gtest/1.12.1\r\n   benchmark/1.6.1\r\n\r\n   [generators]\r\n   CMakeToolchain\r\n   CMakeDeps\r\n   ```\r\n   This downloads and configures GoogleTest and Google Benchmark for your project.\r\n\r\n## Building the Project\r\n\r\n   ```bash\r\n   mkdir -p build \u0026\u0026 cd build\r\n   conan install .. --build=missing -of . -s build_type=RelWithDebInfo\r\n   cmake .. --preset conan-relwithdebinfo\r\n   cmake --build . --config RelWithDebInfo -- -j$(nproc)\r\n   ```\r\n\r\n## Running Unit Tests\r\n\r\nUnit tests are located in the `tests/` directory and are built with GoogleTest. To run the tests:\r\n```bash\r\ncd build\r\nctest --output-on-failure\r\n```\r\nAlternatively, run the test executable directly:\r\n```bash\r\n./tests/unit_tests\r\n```\r\n\r\n## Running Benchmarks\r\n\r\nBenchmark executables (using Google Benchmark) are built in the output directory. From the build directory, run:\r\n```bash\r\n./vector_benchmark\r\n./map_benchmark\r\n./unordered_map_benchmark\r\n./deque_benchmark\r\n```\r\nEach executable measures the performance of various operations on different STL containers.\r\n\r\n## Generating Documentation\r\n\r\nDoxygen documentation can be generated with a dedicated CMake target. Once your build is configured:\r\n```bash\r\ncmake --build . --target doxygen\r\n```\r\nThis command generates HTML documentation under `docs/doxygen/html/`. Open the `index.html` file in your browser to view the documentation.\r\n\r\n## Continuous Integration\r\n\r\nThis project includes a GitHub Actions workflow (see `.github/workflows/ci.yml`) that:\r\n- Checks out the repository.\r\n- Installs system dependencies (cmake, g++, valgrind, etc.).\r\n- Installs Conan via pip and caches the Conan 2 directory (`~/.conan2`) and build directory.\r\n- Configures the project using CMake presets and the Conan toolchain file.\r\n- Builds the project, runs unit tests, and executes benchmarks.\r\n\r\n## Contributing\r\n\r\nContributions are welcome! To contribute:\r\n1. Fork the repository.\r\n2. Create a new branch for your feature or bugfix.\r\n3. Follow the coding guidelines and update tests/documentation as needed.\r\n4. Submit a pull request for review.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmangad%2Fcppdsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmangad%2Fcppdsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmangad%2Fcppdsa/lists"}