explaingit

keon/algorithms

Analysis updated 2026-06-21

25,444PythonAudience · developerComplexity · 1/5Setup · easy

TLDR

A clean, well-documented collection of classic data structures and algorithms implemented in Python 3, designed for studying, interview prep, and importing directly into your own projects.

Mindmap

mindmap
  root((algorithms))
    Topics
      Sorting and searching
      Graphs and trees
      Dynamic programming
      Backtracking
      String matching
    Code quality
      Self-contained files
      Type annotations
      Complexity notes
    Use modes
      Study reference
      Interview prep
      pip installable package
    Audience
      Students
      Job seekers
      Python developers
Click or tap to explore — scroll the page freely

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 build with it?

USE CASE 1

Study classic algorithms like sorting, graph traversal, and dynamic programming using readable, annotated Python examples.

USE CASE 2

Prepare for technical coding interviews by reviewing self-contained reference implementations with complexity notes.

USE CASE 3

Import specific algorithms directly into a Python project after installing the package via pip.

USE CASE 4

Compare different algorithmic approaches to the same problem and understand speed trade-offs.

What is it built with?

Python

How does it compare?

keon/algorithmsblack-forest-labs/fluxcinnamon/kotaemon
Stars25,44425,49625,366
LanguagePythonPythonPython
Setup difficultyeasyhardmoderate
Complexity1/54/53/5
Audiencedeveloperresearcherdeveloper

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

How do you get it running?

Difficulty · easy Time to first run · 5min

In plain English

This repository is a clean, well-documented collection of data structures and algorithms implemented in Python 3. Data structures are ways of organizing information in memory (like lists, trees, or graphs), and algorithms are step-by-step procedures for solving specific computing problems (like sorting a list, finding the shortest path between two points, or searching for a value efficiently). The project is designed to be read and learned from, not just run. Every file is self-contained with explanations, type annotations (labels that say what kind of data a function expects), and notes on complexity (how fast or slow the solution is as input grows). It covers a broad range of topics: sorting and searching, graphs, trees, dynamic programming (breaking large problems into smaller solved subproblems), backtracking (exploring options and undoing bad choices), string matching, mathematical algorithms, and more. You would use this if you are a student learning computer science fundamentals, a developer preparing for technical job interviews, or someone who wants a reference implementation of a classic algorithm written in clean, readable Python. It is also installable as a package via pip, so you can import individual algorithms directly into your own Python projects. The tech stack is Python 3.

Copy-paste prompts

Prompt 1
Show me how to install the keon/algorithms package via pip and import the binary search implementation.
Prompt 2
Give me the dynamic programming solution for the knapsack problem from this repository and explain its complexity.
Prompt 3
Which graph traversal algorithms are included in this collection, and how do I run depth-first search on a custom graph?
Prompt 4
Show me the tree data structure implementations in this repo and how to insert and search for a value.
Prompt 5
How do I run the test suite for all algorithms in this repository to verify they work correctly?

Frequently asked questions

What is algorithms?

A clean, well-documented collection of classic data structures and algorithms implemented in Python 3, designed for studying, interview prep, and importing directly into your own projects.

What language is algorithms written in?

Mainly Python. The stack also includes Python.

How hard is algorithms to set up?

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

Who is algorithms for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub keon on gitmyhub

Verify against the repo before relying on details.