{"id":15047534,"url":"https://github.com/proalgos/proalgos-cpp","last_synced_at":"2025-05-16T11:05:57.280Z","repository":{"id":38379867,"uuid":"76900154","full_name":"ProAlgos/ProAlgos-Cpp","owner":"ProAlgos","description":"C++ implementations of well-known (and some rare) algorithms, while following good software development practices","archived":false,"fork":false,"pushed_at":"2024-04-25T20:13:19.000Z","size":747,"stargazers_count":524,"open_issues_count":9,"forks_count":361,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-05-16T11:05:49.646Z","etag":null,"topics":["algorithm","algorithms","algorithms-and-data-structures","algos","cpp","cpp11","cpp14","cpp17","data-structures","datastructures","proalgos"],"latest_commit_sha":null,"homepage":"","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/ProAlgos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"docs/CODE_OF_CONDUCT.md","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":"2016-12-19T21:51:27.000Z","updated_at":"2025-05-01T16:12:10.000Z","dependencies_parsed_at":"2023-01-19T16:01:29.264Z","dependency_job_id":"3a7d7b3c-44cd-4809-8fb6-bc6e366e7189","html_url":"https://github.com/ProAlgos/ProAlgos-Cpp","commit_stats":{"total_commits":275,"total_committers":50,"mean_commits":5.5,"dds":"0.40727272727272723","last_synced_commit":"7d1834cbc67e3d47bc57fca7eaf8bf4348ab184b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProAlgos%2FProAlgos-Cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProAlgos%2FProAlgos-Cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProAlgos%2FProAlgos-Cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProAlgos%2FProAlgos-Cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProAlgos","download_url":"https://codeload.github.com/ProAlgos/ProAlgos-Cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518383,"owners_count":22084374,"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":["algorithm","algorithms","algorithms-and-data-structures","algos","cpp","cpp11","cpp14","cpp17","data-structures","datastructures","proalgos"],"created_at":"2024-09-24T20:59:51.995Z","updated_at":"2025-05-16T11:05:52.265Z","avatar_url":"https://github.com/ProAlgos.png","language":"C++","readme":"# ProAlgos: C++\n\n[![Travis status][travis-shield]][travis-link]\n\nThis project is focused on implementing **algorithms and data structures** in C++, while following **good software engineering practices**, such as: \n\n- Writing well-documented code\n- Adhering to code guidelines\n- Writing and passing unit tests\n- Reviewing each other's code\n\n## Goals\n\n1. Implement algorithms and data structures\n1. Learn to be better software developers\n1. Guide one another on version control, unit testing, and algorithms\n\n## How to get involved\n\nThere are a few ways to get involved.\n\n#### Want to contribute to open-source and get involved with the project?\n\n1. **Read** the [contribution guidelines][contrib-guide]\n1. **Fork** the repo\n1. **Create an issue** describing what you'd like to add, or **claim an issue** that's [up for grabs][up-for-grabs]\n1. Create a **branch** and **add your code**\n1. Submit a **pull request** and reference the issue it closes\n\nYou can find more details regarding the steps above in the [contribution\nguidelines][contrib-guide], so be sure to check them out.\n\n#### Just want to suggest a new algorithm or report a bug?\n\n[Create a new issue](https://github.com/ProAlgos/ProAlgos-Cpp/issues/new) and we'll\nhandle it from there. :smile:\n\n## Contents\n\n:white_check_mark: = has unit tests\n\n### Algorithms\n\n* Backtracking\n  * [N-Queens](cpp/include/algorithm/backtracking/n_queens.hpp) :white_check_mark:\n\n* Dynamic programming\n  * [0-1 knapsack](cpp/include/algorithm/dynamic_programming/0_1_knapsack.hpp) :white_check_mark:\n  * [Coin change](cpp/include/algorithm/dynamic_programming/coin_change.hpp) :white_check_mark:\n  * [Longest decreasing subsequence](cpp/include/algorithm/dynamic_programming/longest_decreasing_subsequence.hpp) :white_check_mark:\n  * [Matrix chain multiplication](cpp/include/algorithm/dynamic_programming/matrix_chain_multiplication.hpp) :white_check_mark:\n  * Maximum sum contiguous subarray: [Kadane's algorithm](cpp/include/algorithm/dynamic_programming/kadane.hpp) :white_check_mark:\n  * [Rod cutting](cpp/include/algorithm/dynamic_programming/rod_cutting.hpp) :white_check_mark:\n  * [Weighted activity selection](cpp/include/algorithm/dynamic_programming/weighted_activity_selection.hpp) :white_check_mark:\n\n* Number theory\n  * [Binomial coefficient](cpp/include/algorithm/number_theory/binomial_coefficient.hpp) :white_check_mark:\n  * Euclidean algorithms\n    * [Greatest common divisor](cpp/include/algorithm/number_theory/greatest_common_divisor.hpp) (GCD) :white_check_mark:\n    * [Extended Euclidean algorithm](cpp/include/algorithm/number_theory/extended_euclidean.hpp) (Bézout coefficients) :white_check_mark:\n  * [Fast exponentiation](cpp/include/algorithm/number_theory/fast_exponentiation.hpp) :white_check_mark:\n  * Nth Fibonacci number\n    * [Linear time algorithm](cpp/include/algorithm/number_theory/fibonacci.hpp) :white_check_mark:\n    * [Logarithmic time algorithm](cpp/include/algorithm/number_theory/fibonacci_efficient.hpp) :white_check_mark:\n  * [Perfect number check](cpp/include/algorithm/number_theory/perfect_number_check.hpp) :white_check_mark:\n  * Prime numbers\n    * [Primorial](include/algorithm/number_theory/primorial.hpp) :white_check_mark:\n    * [Sieve of Eratosthenes (simple)](cpp/include/algorithm/number_theory/sieve_of_eratosthenes.hpp) :white_check_mark:\n  \n* Searching\n  * [Binary search](cpp/include/algorithm/searching/binary_search.hpp) :white_check_mark:\n  * [Linear search](cpp/include/algorithm/searching/linear_search.hpp) :white_check_mark:\n  * [Ternary search](cpp/include/algorithm/searching/ternary_search.hpp) :white_check_mark:\n  \n* Sorting\n  * [Bubble sort](cpp/include/algorithm/sorting/bubble_sort.hpp) :white_check_mark:\n  * [Bucket sort](cpp/include/algorithm/sorting/bucket_sort.hpp) :white_check_mark:\n  * [Comb sort](cpp/include/algorithm/sorting/comb_sort.hpp) :white_check_mark:\n  * [Counting sort (stable)](cpp/include/algorithm/sorting/counting_sort.hpp) :white_check_mark:\n  * [Heap sort](cpp/include/algorithm/sorting/heap_sort.hpp) :white_check_mark:\n  * [Insertion sort](cpp/include/algorithm/sorting/insertion_sort.hpp) :white_check_mark:\n  * [Merge sort](cpp/include/algorithm/sorting/merge_sort.hpp) :white_check_mark:\n  * [Quick sort](cpp/include/algorithm/sorting/quick_sort.hpp) :white_check_mark:\n  * [Radix sort](cpp/include/algorithm/sorting/radix_sort.hpp)\n  * [Selection sort](cpp/include/algorithm/sorting/selection_sort.hpp) :white_check_mark:\n  * [Shell sort](cpp/include/algorithm/sorting/shell_sort.hpp) :white_check_mark:\n\n* String\n  * [Longest common subsequence](cpp/include/algorithm/string/longest_common_subsequence.hpp) :white_check_mark:\n  * Searching (pattern matching)\n    * [Knuth-Morris-Pratt](cpp/include/algorithm/string/knuth_morris_pratt.hpp) :white_check_mark:\n  * [Edit Distance Problem](cpp/include/algorithm/string/edit_distance.hpp) :white_check_mark:\n  * [Shunting yard](cpp/include/algorithm/string/shunting_yard.hpp) :white_check_mark:\n  * Permutation\n    * [Heap's Algorithm](cpp/include/algorithm/string/heaps_algorithm.hpp) :white_check_mark:\n\n### Data structures\n\n* Linked List\n  * [Singly linked list](cpp/include/data_structure/linked_list/singly_linked_list.hpp) :white_check_mark:\n  * [Doubly linked list](cpp/include/data_structure/linked_list/doubly_linked_list.hpp) :white_check_mark:\n  \n* Queue\n  * [Queue](cpp/include/data_structure/queue/queue.hpp) :white_check_mark:\n  \n* Set\n  * [Disjoint-set](cpp/include/data_structure/set/disjoint_set.hpp) :white_check_mark:\n  \n* Stack\n  * [Stack](cpp/include/data_structure/stack/stack.hpp) :white_check_mark:\n  \n* Tree\n  * [Binary search tree](cpp/include/data_structure/tree/binary_search_tree.hpp) :white_check_mark:\n  * [Fenwick tree](cpp/include/data_structure/tree/fenwick_tree.hpp) :white_check_mark:\n\n## Compiling\n\nTo compile the source files, run **`make`** from the `C++` directory. Doing so will create executable binaries in the `bin` directory.\n\nTo compile and run all tests, run **`make test`**. This will compile all the tests (in the same way as described above) and will run them, displaying the results. \n\nIn order to run a specific test and see its results, run it manually from the `bin` directory after calling `make`. For example, this command (executed from `bin`) would run only the unit tests for the N Queens algorithm:\n\n```\n$ ./n_queens\n```\n\nTo remove all of the files created during compilation, run **`make clean`**. You need not do this every time you make some changes to a file and want to recompile it. Just run **`make`** and it will re-compile just those files whose contents have changed.\n\nTo see what happens in the background during compilation and testing, see the following files:\n\n- [Makefile](cpp/Makefile)\n- [CMakeLists.txt](cpp/CMakeLists.txt)\n- [Testing script](cpp/scripts/run_tests.sh)\n\nFor more information on `make`, see the [GNU make Manual](https://www.gnu.org/software/make/manual/make.html). For more information on `CMake`, see the [CMake Tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html).\n\n## Maintainers\n\nThis project is actively maintained by [@alxmjo](https://github.com/alxmjo), and inactively by [@faheel](https://github.com/faheel).\n\n## License\n\nThis project is licensed under the terms of the [MIT license](LICENSE.md).\n\n[travis-shield]: https://img.shields.io/travis/ProAlgos/ProAlgos-Cpp.svg?style=for-the-badge\n[travis-link]: https://travis-ci.org/ProAlgos/ProAlgos-Cpp\n[contrib-guide]: docs/CONTRIBUTING.md\n[up-for-grabs]: https://github.com/ProAlgos/ProAlgos-Cpp/labels/Up%20for%20grabs\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproalgos%2Fproalgos-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproalgos%2Fproalgos-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproalgos%2Fproalgos-cpp/lists"}