gitwtfhub

wtf is grokking_algorithms?

egonschiele/grokking_algorithms — explained in plain English

Analysis updated 2026-06-24

13,438JavaScriptAudience · generalComplexity · 1/5Setup · easy

TL;DR

This repo holds the example code and high-resolution illustrations from Grokking Algorithms, a beginner-friendly illustrated book teaching common algorithms to non-programmers.

Mindmap

mindmap
  root((grokking algos))
    What it is
      Book companion code
      Algorithm examples
      Teaching illustrations
    Content
      Search algorithms
      Sorting algorithms
      Graph algorithms
    Tech
      Python examples
      Multi-language welcome
      Python Tutor link
    Audience
      Beginners
      Students
      Teachers
    Contribute
      New language examples
      Fix code errors
      Improve readability

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

Why would anyone build with this?

REASON 1

Follow along with the Grokking Algorithms book by running the Python example code while reading each chapter.

REASON 2

Use the book's high-resolution illustrations in teaching slides or presentations with a Manning attribution.

REASON 3

Step through a sorting or search algorithm one line at a time using Python Tutor to see exactly how it works.

REASON 4

Add example code in a new programming language to an existing chapter to help other learners.

What's in the stack?

PythonJavaScript

How it stacks up

egonschiele/grokking_algorithmsmholt/papaparseraspberrypifoundation/blockly
Stars13,43813,45813,404
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasymoderate
Complexity1/52/53/5
Audiencegeneraldeveloperdeveloper

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

How do you spin it up?

Difficulty · easy Time to first run · 5min
Illustrations are copyright Manning Publications and free for non-commercial use like teaching slides, add a credit line when using them.

Wtf does this do

This repository holds the example code that accompanies the book Grokking Algorithms by Aditya Bhargava, published by Manning. The book is a beginner-friendly, illustrated introduction to algorithms, the step-by-step methods computers use to solve problems like searching through data or sorting lists. This repo is the companion code so readers can run and study the examples while working through the chapters. The README is short and practical. It points to Python Tutor, an external website that steps through Python code one line at a time, which the author recommends as a way to follow along with the examples. It also links to an errata page listing corrections to mistakes found in the book after it was printed. Another notable part of the repository is the images. The author says every illustration from the book is included here in high resolution, and these are available for non-commercial use such as teaching slides or presentations. Anyone using an image is asked to add a credit line: "copyright Manning Publications, drawn by adit.io." The README also explains how to contribute. The author asks that questions or reports of book errors go to his email rather than GitHub issues, since he responds there faster. For code changes, pull requests are preferred over issues. He is upfront that he can be slow to respond but says he does get to them eventually. The contributions he values most are fixing errors in existing code, adding examples in additional programming languages, updating code as languages evolve, and making examples clearer to read. Equally telling is what he declines: purely stylistic changes and complex performance optimizations are unlikely to be merged. The reason is that the purpose of the repo is to keep examples simple enough that someone learning the concept can follow them without getting lost in clever tricks.

Yoink these prompts

Prompt 1
I'm reading chapter 4 of Grokking Algorithms on quicksort. Show me how to run the example code in Python and step through it in Python Tutor.
Prompt 2
Walk me through the binary search example from Grokking Algorithms and explain each step in plain English without code jargon.
Prompt 3
I want to add JavaScript versions of the Grokking Algorithms examples. Show me how to convert the binary search Python code to JavaScript in the same simple readable style.
Prompt 4
Explain the breadth-first search algorithm using the ideas from Grokking Algorithms in plain language, no math notation.

Frequently asked questions

wtf is grokking_algorithms?

This repo holds the example code and high-resolution illustrations from Grokking Algorithms, a beginner-friendly illustrated book teaching common algorithms to non-programmers.

What language is grokking_algorithms written in?

Mainly JavaScript. The stack also includes Python, JavaScript.

What license does grokking_algorithms use?

Illustrations are copyright Manning Publications and free for non-commercial use like teaching slides, add a credit line when using them.

How hard is grokking_algorithms to set up?

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

Who is grokking_algorithms for?

Mainly general.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.