git404hub

what is cosmos fr?

opengenus/cosmos — explained in plain English

Analysis updated 2026-06-24

13,709C++Audience · developerComplexity · 1/5LicenseSetup · easy

tl;dr

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.

vibe map

mindmap
  root((cosmos))
    What it does
      Algorithm reference
      Multi-language code
      25 topic areas
    Tech Stack
      C++ and C
      Python and Java
      Go and JavaScript
    Audience
      CS students
      Interview preppers
      Contributors
    Use Cases
      Offline reference
      Language comparison
      Internship credit

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Browse offline reference implementations of sorting, searching, or graph algorithms in your preferred language

VIBE 2

Study how the same algorithm is solved differently across C++, Python, Java, and Go side by side

VIBE 3

Contribute an algorithm implementation to build open-source experience through the OpenGenus internship program

what's the stack?

C++CJavaPythonGoJavaScriptSwift

how it stacks up fr

opengenus/cosmosqgis/qgisapache/incubator-weex
Stars13,70913,74413,632
LanguageC++C++C++
Setup difficultyeasymoderatehard
Complexity1/54/54/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min
You can use and share this code freely, but any project you build with it must also be released as open source under the same GPL v3 license.

in plain english

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.

prompts (copy fr)

prompt 1
Using the opengenus/cosmos coding style, write me a Python implementation of Dijkstra's shortest path algorithm with comments explaining each step
prompt 2
Show me how to implement a red-black tree in C++ following the structure used in the cosmos repository
prompt 3
I want to contribute a new sorting algorithm to opengenus/cosmos, write me a cycle sort implementation in Java that matches their conventions
prompt 4
Using cosmos as a reference, show me BFS and DFS graph traversal implemented side by side in Go so I can see how they differ

Frequently asked questions

what is cosmos fr?

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.

What language is cosmos written in?

Mainly C++. The stack also includes C++, C, Java.

What license does cosmos use?

You can use and share this code freely, but any project you build with it must also be released as open source under the same GPL v3 license.

How hard is cosmos to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is cosmos for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.