explaingit

egonschiele/grokking_algorithms

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

TLDR

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
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

Things people build with this

USE CASE 1

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

USE CASE 2

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

USE CASE 3

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

USE CASE 4

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

Tech stack

PythonJavaScript

Getting it running

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.

In plain English

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.

Copy-paste 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.
Open on GitHub → Explain another repo

← egonschiele on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.