CPU调度算法(CPU Scheduling Algorithms)、位操作(Bit Manipulation)、回溯(Backtracking)算法等C++版算法实现。涵盖了计算机科学、数学和统计、数据科学、机器学习、工程等领域的各种主题。

David Leal 6376bf46af chore: add `workflow_dispatch` in directory workflow 2 months ago
.github 6376bf46af chore: add `workflow_dispatch` in directory workflow 2 months ago
.vscode d7a9869dce feat: add Boyer Moore algorithm implementation (#2441) 5 months ago
backtracking 6027480643 feat: add well-formed parentheses generator (#2445) 6 months ago
bit_manipulation e3f0551f98 [fix/docs]: fit `check_amicable_pair.cpp` to guidelines (#2465) 5 months ago
ciphers e64e3df18f fix: CodeQL warnings (#1827) 2 years ago
cpu_scheduling_algorithms 26f6e98d9e chore: add `cpu_scheduling_algorithms` to CMake (#2477) 5 months ago
data_structures 170f7e59ff feat: Treap Data Structure (#2458) 4 months ago
divide_and_conquer 5b238724b8 feat: add Strassen's Matrix Multiplication (#2413) 10 months ago
doc aaa08b0150 Major rework to improve code quality and add automation checks (#805) 3 years ago
dynamic_programming 7003ba83ea feat: improve the Armstrong Number algorithm (#2480) 4 months ago
games b0b183df92 feat: add memory game and a games folder (#2471) 5 months ago
geometry ea76786f12 feat: Added Graham Scan Algorithm. (#1836) 2 years ago
graph 8a6f2052e2 feat: Created midpoint integration numerical method (#1785) 2 years ago
graphics 813175a544 feat: upgrade FreeGlut to v3.4.0 (#2478) 4 months ago
greedy_algorithms 2c68b68ca6 fix: add missing namespace in Dijkstra 4 months ago
hashing ff80be4b0a feat: Add SHA-256 hashing algorithm (#2470) 5 months ago
machine_learning a8af29bf65 feat: add k-nearest neighbors algorithm (#2416) 10 months ago
math 17a532637a feat: add Iterative Factorial (#2453) 4 months ago
numerical_methods 2a076c1b03 feat: move `gram_schmidt` to `numerical_methods` (#1940) 1 year ago
operations_on_datastructures 1f0eff28d0 fix: Circular linked list (#1825) 2 years ago
others c876e50a7b feat: add Kelvin to Celsius conversion algorithm (#2475) 5 months ago
physics 1a6ca12456 feat: add `physics` to CMake lists (#2481) 5 months ago
probability 85721be69b feat: Modify search/text_search.cpp (#1662) 2 years ago
range_queries 882ba119dc [feat/docs]: improve Fenwick Tree algorithm (#2506) 4 months ago
scripts f4d1aa1706 chore: add the linter to a separate Python script (#2500) 5 months ago
search 1645cf281f feat: add new Median Search implementation (#1992) 1 year ago
sorting 29f54393f3 feat: add Stooge sort algorithm (#2440) 7 months ago
strings 2d492834b1 feat: update CMake version to 3.26.4 (#2486) 5 months ago
.clang-format c4f586b6ab [bug fix] fix code formatting in CI (#1052) 3 years ago
.clang-tidy b4bbe9dc4e [code fix] Fixed trie_tree for code quality and docs & clang-tidy error check (#1059) 3 years ago
.gitignore f4d1aa1706 chore: add the linter to a separate Python script (#2500) 5 months ago
.gitpod.dockerfile 5282286408 install freeglut3-dev (#973) 3 years ago
.gitpod.yml 5bfc7740c8 fix: remove the `ms-vscode.cpptools` extension 2 years ago
CMakeLists.txt 25b9e0a159 feat: update cmake to use a newer version (#2505) 4 months ago
CODE_OF_CONDUCT.md 1e8376eedb fix: Update the CoC to match the `.github` repository (#1832) 2 years ago
CONTRIBUTING.md c0c27153cd fix: self-test example not working 7 months ago
CodingGuidelines.md 0c5c096991 [feat/fix]: Improve the contributing guidelines... (#1522) 2 years ago
DIRECTORY.md f49369065c docs: update DIRECTORY.md (#2521) 2 months ago
LICENSE c5a89b9f94 chore: update copyright notices to 2022 1 year ago
README.md 1bfd46e92c docs: update workflow versions in `README.md` (#2483) 5 months ago
REVIEWER_CODE.md 79b98cc905 feat: guidelines for reviewers (#1302) 3 years ago


The Algorithms - C++ # {#mainpage}

Gitpod Ready-to-Code CodeQL CI Gitter chat contributions welcome GitHub repo size Doxygen CI Awesome CI Income Discord chat Donate


This repository is a collection of open-source implementation of a variety of algorithms implemented in C++ and licensed under MIT License. These algorithms span a variety of topics from computer science, mathematics and statistics, data science, machine learning, engineering, etc.. The implementations and the associated documentation are meant to provide a learning resource for educators and students. Hence, one may find more than one implementation for the same objective but using a different algorithm strategies and optimizations.


  • The repository provides implementations of various algorithms in one of the most fundamental general purpose languages - C++.
  • Well documented source code with detailed explanations provide a valuable resource for educators and students alike.
  • Each source code is atomic using STL classes and no external libraries are required for their compilation and execution. Thus, the fundamentals of the algorithms can be studied in much depth.
  • Source codes are compiled and tested for every commit on the latest versions of three major operating systems viz., Windows, MacOS, and Ubuntu (Linux) using MSVC 19 2022, AppleClang 14.0.0, and GNU 11.3.0 respectively.
  • Strict adherence to C++11 standard ensures portability of code to embedded systems as well like ESP32, ARM Cortex, etc. with little to no changes.
  • Self-checks within programs ensure correct implementations with confidence.
  • Modular implementations and OpenSource licensing enable the functions to be utilized conveniently in other applications.


Online Documentation is generated from the repository source codes directly. The documentation contains all resources including source code snippets, details on execution of the programs, diagrammatic representation of program flow, and links to external resources where necessary. The documentation also introduces interactive source code with links to documentation for C++ STL library functions used. Click on Files menu to see the list of all the files documented with the code.

Documentation of Algorithms in C++ by The Algorithms Contributors is licensed under CC BY-SA 4.0
Creative Commons LicenseCredit must be given to the creatorAdaptations must be shared under the same terms


As a community developed and maintained repository, we welcome new un-plagiarized quality contributions. Please read our Contribution Guidelines.