CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

krahets/hello-algo

Scanned commit 28c1e74c1d dated 2026-08-18 — last upstream commit. Generated by codevetter 1.12.0 on 2026-09-22.

github.com/krahets/hello-algo ↗ · 4000 files · 11.9 MB · scan capped

动画图解、一键运行的数据结构与算法教程 简体中文 | 繁體中文 | English | 日本語 | Русский 关于本书 本项目旨在打造一本开源免费、新手友好的数据结构与算法入门教程。 - 全书采用动画图解,内容清晰易懂、学习曲线平滑,引导初学者探索数据结构与算法的知识地图。 - 源代码可一键运行,帮助读者在练习中提升编程技能,了解算法工作原理和数据结构底层实现。 - 提倡读者互助学习,欢迎大家在评论区提出问题与分享见解,在交流讨论中共同进步。 若本书对您有所帮助,请在页面右上角点个 Star :star: 支

Deep analysis by swe-2 via the devin CLI on 2026-09-22 (runtime not recorded) — every claim below links to its cited source files.

Overview

hello-algo ("Hello 算法") is a large open-source data-structures-and-algorithms tutorial by krahets, published at hello-algo.com and licensed CC BY-NC-SA 4.0. It is not an application: the repo is a MkDocs Material static site (5 language locales: zh, zh-hant, en, ja, ru) plus a parallel corpus of ~1,500 runnable algorithm samples across 16 programming languages under codes/. Its distinctive traits are per-language tabbed code blocks, step-through frame animations embedded in the markdown, and PythonTutor links for visual execution — with CI that validates every sample by compiling or executing it.

System map

The system has two coupled halves: (1) a MkDocs Material documentation site whose source lives in docs/ with theme overrides in overrides/ and build config in mkdocs.yml, and (2) a multi-language code corpus in codes/ organized as chapter_* directories mirroring the book chapters. Four locale trees (en/, ja/, ru/, zh-hant/) replicate the whole structure, each with its own mkdocs.yml that uses INHERIT to extend the root config. The Dockerfile is the deployment entrypoint: it builds all five locale sites into a single site/ tree and serves it with python -m http.server on port 8000 via docker-compose. There is no runtime backend, database, or service layer — the only external integrations are CDN-loaded assets (MathJax, giscus) and GitHub Discussions for comments.

Feature catalog

User-facing features are reading/learning features rather than app features: a 16-chapter illustrated book, per-language tabbed code samples, step-through frame animations, collapsible PythonTutor visual-execution links, runnable driver-code files, a giscus comment section per page, light/dark themes, full-text search, MathJax math rendering, a custom hero landing page, and five site locales. Contribution-facing features include per-page edit buttons wired to GitHub, a PR template with separate checklists for translation vs. code contributions, and Docker-based one-command local deployment.

All 14 feature catalog claims →

Data flow

Data flow is a static publishing pipeline rather than a runtime system. Author inputs are markdown pages, PNG frame assets, and code files; these flow through a staged build/ directory into per-locale mkdocs builds, producing one static site/ tree served over HTTP. Code samples move by manual transcription: authors write codes/<lang>/chapter_* files, then copy excerpts into the docs' tabbed blocks and into URL-encoded PythonTutor links. At view time the browser pulls third-party resources (MathJax CDN, giscus.app, pythontutor.com, contrib.rocks) — the repo itself serves only static files.

Behavior traces

Key flows traced end-to-end: (1) the Docker build that produces and serves the five-locale site; (2) the Python CI lane that lints then executes every sample via a glob-and-subprocess harness; (3) a reader's page view, where markdown tabs, animation frames, MathJax and giscus all hydrate client-side; (4) adding a Rust sample, which requires a manual [[bin]] registry entry before cargo run works; and (5) the Go lane where driver code lives in _test.go files executed by 'go test'.

Testing signals

Testing is 'does it compile and run' rather than assertion-based verification. Each language has either a run-all harness (Python test_all.py, JS test_all.js), native test drivers used as print harnesses (Go _test.go, ctest), or compile-only checks (Rust cargo build, TypeScript tsc --noEmit, Java javac, C/C++ cmake builds). There are no unit-test assertions on algorithm outputs, no docs/link checking, no site-build CI, and no coverage tooling. Coverage gaps: zig and pythontutor have no workflow at all, and zh-hant/ja/ru code trees are outside every workflow's path filter.

Risk map

The dominant risks are duplication and drift: the same sample logic exists in up to five copies (codes/ + four locale trees) and again inline in the markdown tabs, with only human discipline and PR checklists keeping them consistent. CI has real holes (no zig workflow, no coverage of zh-hant/ja/ru code paths, compile-only checks for several languages). Secondary risks: a subprocess-based runner that executes contributor code, several apparently dead assets (starfield.js, pythontutor-iframe CSS, missing checkin.html), vendored third-party headers, stale GitHub Actions versions/runners, and heavy reliance on external services (giscus, pythontutor.com, CDNs).

Extension points

The repo is built to be extended in five dimensions: new programming languages (add a codes/<lang> mirror + workflow + docs tabs), new chapters/sections (docs/chapter_x + nav entry + per-language code dirs), new locales (copy tree + INHERIT config + Dockerfile stage + alternate entry), new page features (custom admonition types, animation frame sets, pythontutor embeds), and theme behavior (override partials + CSS/JS). Some extension is registry-driven (Cargo.toml [[bin]], CMakeLists add_executable, mkdocs.yml nav) while the run-all harnesses auto-discover files via chapter_* globs.

Contributor handoff

This is a content monorepo, not an app — treat it as five parallel trees (root zh + en, zh-hant, ja, ru) over two artifact types (docs markdown, runnable code). Read mkdocs.yml, Dockerfile, and the contribution docs first. The prime directive is consistency: any code change belongs in codes/ AND all locale codes/ copies AND the inline tabs in the docs pages; any structural change (new chapter/language) touches nav, manifests, workflows, and Docker stages together. Validate with the language's own harness before submitting; correctness means 'runs and prints the same results as the Python/Java reference' per the PR template.

Languages

LanguageFilesShare of source
Markdown871docs/config
Go69513%
Swift4558%
C++4508%
Rust4508%
Python4458%
C#4408%
Java4358%

Start reading here

Probable source entrypoint: codes/ — inferred from the directory tree and manifest, not the upstream docs.

Source roots

codes/ (768 files) ru/ (768 files) ja/ (768 files)

Source layout — codes/

PathFiles
codes/c/100
codes/cpp/106
codes/csharp/87
codes/go/36
codes/Dockerfile1

Repository structure

Top-level pathFiles
codes/768
ru/768
ja/768
en/768
zh-hant/767
docs/123
overrides/16
.github/14

Docs found: README.mddocs/chapter_appendix/contribution.mddocs/chapter_appendix/index.mddocs/chapter_appendix/installation.mddocs/chapter_appendix/terminology.mddocs/chapter_array_and_linkedlist/array.mddocs/chapter_array_and_linkedlist/exercises.mddocs/chapter_array_and_linkedlist/index.mddocs/chapter_array_and_linkedlist/linked_list.mddocs/chapter_array_and_linkedlist/list.md

Package

codes/go/go.mod — github.com/krahets/hello-algo, 0 declared dependencies.

CI & config entrypoints

Structural health signals

Average score 7.1/10 across 96 analyzed source files; 7 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history