A community-maintained collection of algorithms implemented in Python, intended for learning and education.
TheAlgorithms/C-Plus-Plus
A educational collection of algorithms and data structures implemented in C++17 with no external libraries, spanning math, ML, CS and physics.
- Stars
- 34,793
- Forks
- 7,889
- Open issues
- 40
- Last commit
- 22 days ago
What is it?
The Algorithms - C++ is a community-maintained collection of algorithm implementations written in C++. The topics span computer science, mathematics and statistics, data science, machine learning, and engineering, and the same objective is often implemented with several different strategies so readers can compare them.
Each source file is self-contained, uses only the C++ standard library (STL), and follows the C++17 standard, so the code is intended to compile on MSVC, AppleClang and GNU toolchains across Windows, macOS and Linux. Every commit is compiled and tested by CI on those three operating systems. The source is documented with explanations, and generated online documentation includes the code, run instructions and program-flow diagrams.
The project is aimed at educators, students and interview candidates who want to study how an algorithm works. It is released under the MIT License and accepts contributions under its contribution guidelines.
Key features
- 01Implements many algorithms across math, machine learning, computer science and physics in C++.
- 02Uses only the STL, so no external libraries are needed to build or run the code.
- 03Targets C++17 and is tested on Windows, macOS and Ubuntu in CI.
- 04Provides multiple implementations of the same problem using different strategies.
- 05Includes online generated documentation with code, explanations and program-flow diagrams.
Use cases
- Studying how sorting, searching or data structure algorithms work in C++.
- Preparing for coding interviews or competitive programming with reference implementations.
- Teaching algorithms in a university or course that uses C++.
- Looking up a compact, dependency-free implementation to adapt for an embedded or C++17 project.
In collections
Topics
FAQ
- What is C-Plus-Plus?
- A educational collection of algorithms and data structures implemented in C++17 with no external libraries, spanning math, ML, CS and physics. The Algorithms - C++ is a community-maintained collection of algorithm implementations written in C++. The topics span computer science, mathematics and statistics, data science, machine learning, and engineering, and the same objective is often implemented with several different strategies so readers can compare them.
- Is C-Plus-Plus free to use? What license does it have?
- C-Plus-Plus is open source under the MIT license. Check the license terms before using it in commercial products.
- Is C-Plus-Plus still maintained?
- Actively maintained. The last commit to C-Plus-Plus was on Oct 3, 2026.
- What can I use C-Plus-Plus for?
- Studying how sorting, searching or data structure algorithms work in C++. Preparing for coding interviews or competitive programming with reference implementations. Teaching algorithms in a university or course that uses C++. Looking up a compact, dependency-free implementation to adapt for an embedded or C++17 project.
- Where can I get C-Plus-Plus?
- The source code and installation instructions are on GitHub: https://github.com/TheAlgorithms/C-Plus-Plus
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A collection of classic algorithms and data structures implemented in Go, intended for learning and interview preparation.
Go solutions to LeetCode problems with a companion Cookbook e-book, covering data structures and algorithms for interview prep.
A JavaScript collection of classic algorithms and data structures, each with explanations and further reading links.
A free, open-source, illustrated data structures and algorithms textbook with runnable code in more than a dozen programming languages.
A collection of classic algorithms and data structures implemented in Java, intended for learning.