Open-source project
kelvins/algorithms-and-data-structures avatar
kelvins/algorithms-and-data-structures

algorithms-and-data-structures: one algorithm per file, across eleven languages

:abacus: Algorithms and Data Structures in several Programming Languages

1,088 stars272 forksPythonMIT

At a glance

What is it?
This repository collects classic algorithms and data structures implemented in C, C++, Java, Python, Go, Ruby, JavaScript, Swift, Rust, Scala and Kotlin, laid out as a matrix where each cell is a language port of the same algorithm. It suits a learner who wants to see the same idea in several languages, and it is the wrong thing to reach for as a production library.
Who is it for?
This repository suits a developer who learns algorithms by comparing implementations, since the same algorithm appearing in eleven languages side by side makes the language-specific part obvious and the algorithmic part portable. It is a poor fit as a dependency, because there is no package manifest, no test suite and no versioning scheme beyond the default branch, so nothing here is meant to be imported.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 68 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The structure is a matrix, and the gaps in it are informative

The repository presents itself as a table with algorithms down the side and programming languages across the top, and each cell is either a link to an implementation or a link to the contribution guide. The languages are C, C++, Java, Python, Go, Ruby, JavaScript, Swift, Rust, Scala and Kotlin, and the README gives the reason for the matrix, to achieve greater coverage and encourage more people to contribute. The A* row is entirely links to CONTRIBUTING.md, which means that algorithm is not yet implemented anywhere. The Bellman-Ford row has one real implementation, src/cpp/FloydWarshall.cpp, with the rest pointing at the contribution guide. That last case is a naming artefact worth noting: the C++ file carries a Floyd-Warshall filename while sitting in the Bellman-Ford row, which tells you the layout is loosely curated rather than mechanically verified.

Source is organised by language, not by algorithm

The repository root is small. It holds README.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md, LICENSE, a.github directory, a.gitignore, a logos directory and a src directory. The only implementation path visible in the repository listing sits inside src, and it is qualified by a language, in the form src/cpp/FloydWarshall.cpp. The logos directory holds the per-language badge images used in the table, one SVG per language, with github.svg standing in for the not-yet-implemented cells. So the convention is one directory per language, and within it one file per algorithm, with the filename carrying the algorithm name. That convention is simple enough to navigate with a file browser, and it is the reason the project can grow by eleven independent contributions without a central index.

Each cell links to a browser playground, not to a local build

The table's header row links each language logo to an online compiler rather than to documentation. C, C++, Java, Python and JavaScript point at SoloLearn compiler playground pages, Go points at the official Go playground at go.dev/play, Ruby at try.ruby-lang.org, Swift at SwiftFiddle, Rust at play.rust-lang.org, Scala at Scastie, and Kotlin at play.kotlinlang.org. That choice has a real consequence for how the repository is meant to be used. The intended workflow is read the file, then paste or adapt it into a browser-based REPL for that language and watch it run. There is no build step, no dependency file and no container in the repository root, because there is nothing to build. For a reference collection that is the right design, and for anything else it means the code has to be extracted by hand.

The scope is deliberately wider than textbook algorithms

The README describes the contents as several classic algorithms and data structures in computer science, as well as some extra problems that are frequently encountered in programming challenges. That second clause is what separates this from a course repository. The topic tags on the repository include searching-algorithms and sorting-algorithms alongside the broader algorithms and data-structures-and-algorithms, plus education, learning, practice and hacktoberfest. The framing is therefore a practice and teaching collection rather than a reference implementation, and the inclusion of the frequently encountered contest problems is what makes it useful for someone preparing for interviews or competitive programming, where the gap between the textbook list and the actual problem set is where people lose time.

Contribution is the mechanism, and the guide is the front door

Every empty cell in the table links to CONTRIBUTING.md, which makes that file the project's primary interface for a new contributor. The repository also carries a CODE_OF_CONDUCT.md and a .github directory, so it has the governance files a project accepting outside contributions normally needs. The README's framing of the matrix as a way to encourage more contributors explains the design: the work is decomposed into small, independent, language-scoped units, and each one is a pull request that does not need to agree with the others. A reader can also infer where the gaps are by looking at which cells point at the contribution guide instead of a file, which is effectively a published to-do list of the whole matrix.

What is missing is what a library would have

Read strictly against what the repository actually contains, it has no package manifest, no test suite directory, no continuous integration configuration in the root listing, and no release history, since the repository publishes no GitHub releases. The primary language is recorded as Python, and the last push was on 2026-08-17. None of that is a criticism so much as a description of the category: this is educational source code, not a distributable library. There is no API surface to depend on, no semantic versioning to pin against, and no compatibility promise for the behaviour of any given implementation. Anyone treating it as a dependency would be relying on the default branch of a repository whose content changes as contributions land, which is a different thing entirely from importing a package.

Licensing is permissive, and per-file authorship is the nuance

The repository is MIT licensed, with a LICENSE file at the root. For code that people copy and paste into their own projects, that matters more than it would for a library, because a snippet pasted into a proprietary codebase is now part of that codebase. The MIT terms require that the copyright notice and permission notice travel with the copied code, and the practical question for a snippet is who holds the copyright, since each of the eleven language ports is a separate contribution with its own author. The CODE_OF_CONDUCT.md in the root is the marker that the project has a community agreement, and the contributors structure implied by the table means the copyright holders across the matrix are not the same people. Anyone reusing a specific file rather than the repository as a whole should check that file's own history.

Editorial conclusion

This repository suits a developer who learns algorithms by comparing implementations, since the same algorithm appearing in eleven languages side by side makes the language-specific part obvious and the algorithmic part portable. It is a poor fit as a dependency, because there is no package manifest, no test suite and no versioning scheme beyond the default branch, so nothing here is meant to be imported. Verify first whether the algorithm you need actually exists in your language of choice, since the table shows coverage gaps, with cells pointing to CONTRIBUTING.md rather than to an implementation, and check the LICENSE before copying code into a product, because the repository is MIT but each individual contribution carries its own authorship.

Frequently asked questions

Which programming languages does the algorithms-and-data-structures repository cover?

The README lists C, C++, Java, Python, Go, Ruby, JavaScript, Swift, Rust, Scala and Kotlin. Each algorithm in the table is a row and each language a column, and a cell either links to an implementation or to the contribution guide where the port is still missing.

How are the implementations organised?

Under the src directory, with one directory per language and one file per algorithm, following the pattern shown by src/cpp/FloydWarshall.cpp. The logos directory holds the per-language badge images used in the table, with a GitHub badge standing in for cells that are not yet implemented.

Can I run the code from the repository directly?

There is no build step, dependency file or container in the repository. The table links each language to an online playground such as the Go playground, SwiftFiddle or Scastie, so the intended workflow is to read a file and paste or adapt it into a browser-based REPL.

What licence applies to the code?

The repository carries an MIT licence in the LICENSE file at the root, which permits reuse in commercial and closed-source code provided the copyright and permission notices are retained.

Official sources

  1. Issues
  2. kelvins/algorithms-and-data-structures on GitHub
  3. License: MIT
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/kelvins-algorithms-and-data-structures.svg)](https://hysenlabs.com/projects/kelvins-algorithms-and-data-structures)

Was this useful?