{"id":31725691,"url":"https://github.com/davidhintelmann/cpp-algorithms","last_synced_at":"2025-10-09T05:56:48.548Z","repository":{"id":316991540,"uuid":"1065593444","full_name":"davidhintelmann/cpp-algorithms","owner":"davidhintelmann","description":"C++ implementations of algorithms and data structures from the classic textbook Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein (CLRS)","archived":false,"fork":false,"pushed_at":"2025-09-28T03:22:04.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-28T05:37:11.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/davidhintelmann.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-28T03:19:23.000Z","updated_at":"2025-09-28T03:22:08.000Z","dependencies_parsed_at":"2025-09-28T05:37:15.953Z","dependency_job_id":null,"html_url":"https://github.com/davidhintelmann/cpp-algorithms","commit_stats":null,"previous_names":["davidhintelmann/cpp-algorithms"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/davidhintelmann/cpp-algorithms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhintelmann%2Fcpp-algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhintelmann%2Fcpp-algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhintelmann%2Fcpp-algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhintelmann%2Fcpp-algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidhintelmann","download_url":"https://codeload.github.com/davidhintelmann/cpp-algorithms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhintelmann%2Fcpp-algorithms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000741,"owners_count":26082932,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-10-09T05:56:47.730Z","updated_at":"2025-10-09T05:56:48.543Z","avatar_url":"https://github.com/davidhintelmann.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++ Algorithms from Introduction to Algorithms (CLRS)\n\nThis repository contains C++ implementations of algorithms and data structures from the classic textbook Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein (CLRS).\n\nThere are two goals for this repo:\n1. Provide clear, well-documented implementations for learners.\n2. Showcase C++ programming and algorithmic problem-solving skills.\n\n## Repository Structure\n\n```\ncpp-algorithms/\n│── README.md\n│── LICENSE\n│── .gitignore\n│── CMakeLists.txt\n│\n├── docs/                    # Explanations, notes, and complexity analysis\n│   ├── 01-introduction.md\n│   ├── 02-sorting.md\n│   └── ...\n│\n├── include/                 # Reusable headers\n│   └── algorithms/\n│       ├── sorting.hpp\n│       ├── graph.hpp\n│       └── dp.hpp\n│\n├── src/                     # Algorithm implementations\n│   ├── sorting/\n│   │   ├── insertion_sort.cpp\n│   │   ├── quicksort.cpp\n│   │   └── heapsort.cpp\n│   ├── data_structures/\n│   │   ├── linked_list.cpp\n│   │   └── red_black_tree.cpp\n│   ├── graphs/\n│   │   ├── bfs.cpp\n│   │   ├── dfs.cpp\n│   │   └── dijkstra.cpp\n│   └── ...\n│\n└── tests/                   # Unit tests\n    ├── test_sorting.cpp\n    ├── test_graphs.cpp\n    └── ...\n```\n\n## Compilation \u0026 Usage\n\nPrerequisites\n- C++ compiler (GCC, Clang, MSVC)\n  - C++17 or later\n- CMake (optional, for easier builds)\n\n### Compile a Single File (using g++)\n\n```bash\ng++ -std=c++20 -O2 src/sorting/insertion_sort.cpp -o insertion_sort\n./insertion_sort\n```\n\n### Build with CMake\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n## Algorithms Implemented\n1. Foundations\n   - [x] Bubble Sort\n   - [x] Insertion Sort\n   - [x] Merge Sort\n   - [ ] Analyzing Algorithms\n2. Sorting \u0026 Order Statistics\n   - [ ] Heapsort\n   - [ ] Quicksort\n   - [ ] Counting Sort\n   - [ ] Radix Sort\n   - [ ] Bucket Sort\n3. Data Structures\n   - [ ] Linked List\n   - [ ] Binary Search Tree\n   - [ ] Red-Black Tree\n   - [ ] Hash Table\n4. Graph Algorithms\n   - [ ] BFS (Breadth-First Search)\n   - [ ] DFS (Depth-First Search)\n   - [ ] Dijkstra’s Algorithm\n   - [ ] Kruskal’s Algorithm\n   - [ ] Prim’s Algorithm\n  \n*More algorithms will be added progressively — see Roadmap*\n\n## Tests \n\nThis repo makes use of [googletest](https://github.com/google/googletest), a Google Testing and Mocking Framework for C++\n\nAfter building this project with cmake, you will find a binary file inside the `build` directory called `runTests`\n\n## Documentation\n\nEach algorithm includes:\n- Source code in src/\n- Explanation in docs/\n- Complexity analysis\n- Example usage in test cases\n\nExample documentation:\n1. [docs/01-introduction.md](docs/01-introduction.md)\n2. [docs/02-sorting.md](docs/02-sorting.md)\n\n## Roadmap\n- [ ] Complete all major Sorting algorithms\n- [ ] Implement Dynamic Programming problems (Rod Cutting, LCS, Matrix Chain Multiplication)\n- [ ] Implement Graph Algorithms (MSTs, Shortest Paths, Max Flow)\n- [ ] Add Number Theory algorithms (GCD, Modular Arithmetic, RSA)\n- [ ] Expand Advanced Data Structures (Red-Black Trees, B-Trees, Disjoint Sets)\n- [ ] Add Unit Tests with GoogleTest / Catch2\n- [ ] Provide Visualizations for key algorithms (via external tools or diagrams in `docs/`)\n\n## Contributing\n\nContributions are welcome!\n- Open issues for bugs or suggestions\n- Fork the repo \u0026 submit PRs with improvements\n- Follow consistent coding style (C++20, clang-format recommended)\n\n## License\n\nThis project is licensed under the MIT License — see [LICENSE](./LICENSE)\n\n## Acknowledgments\n- Introduction to Algorithms (CLRS), 4th Edition\n  - Thomas H. Cormen\n  - Charles E. Leiserson\n  - Ronald L. Rivest\n  - Clifford Stein\n- Open-source algorithm communities for inspiration\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidhintelmann%2Fcpp-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidhintelmann%2Fcpp-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidhintelmann%2Fcpp-algorithms/lists"}