cosmos
World's largest Contributor driven code dataset | Used in Quark Search Engine, @OpenGenus IQ, OpenGenus Visual Project
A community-maintained collection of algorithm and data structure implementations across 25+ computer science topics, with working code in C, C++, Java, Python, Go, JavaScript, and more.
Cosmos is a large collection of algorithm and data structure implementations maintained by the OpenGenus community. The idea is to give programmers an offline reference covering the breadth of foundational computer science topics, with code written in multiple languages so you can see how the same problem is solved in C, C++, Java, Python, Go, JavaScript, Swift, and others.
The repository is organized into around 25 broad topic areas: artificial intelligence, backtracking, bit manipulation, cellular automaton, compression, computational geometry, cryptography, data structures, design patterns, divide and conquer, dynamic programming, graph algorithms, greedy algorithms, mathematical algorithms, networking, numerical analysis, operating system concepts, quantum algorithms, randomized algorithms, searching, sorting, string algorithms, and several more. Each area contains many specific problems with working implementations in the supported languages.
The project is contributor-driven. Over 1,000 people have added code to the repository, which is why the collection is large enough to serve as a self-contained offline reference. A small team of active maintainers reviews incoming contributions and keeps quality consistent. The wiki includes contributing guidelines and per-language style guides for anyone who wants to add implementations or documentation.
OpenGenus also runs an internship program connected to this repository, where participants earn credit by making meaningful contributions.
The code in Cosmos feeds into other OpenGenus products: a search engine called Quark and a knowledge platform called OpenGenus IQ, where the implementations appear alongside written explanations of each algorithm or data structure.
The project is licensed under the GNU General Public License version 3. Sponsors include DigitalOcean and Discourse.
Where it fits
- Browse offline reference implementations of sorting, searching, or graph algorithms in your preferred language
- Study how the same algorithm is solved differently across C++, Python, Java, and Go side by side
- Contribute an algorithm implementation to build open-source experience through the OpenGenus internship program