login
RepoCritics — Review. Share. Archive. Every open-source repo.

labuladong/fucking-algorithm

Wiki: labuladong/fucking-algorithm

Source: https://github.com/labuladong/fucking-algorithm

Last synced 2026-06-02 · 453 words · Edit wiki on GitHub →

labuladong/fucking-algorithm

A Chinese-language algorithm-patterns guide — "Crack LeetCode, not only how, but also why" — focuses on the framework-thinking behind algorithm problems rather than memorizing solutions.

What it is

A long-form Chinese-language reference that teaches algorithm patterns (sliding window, two pointers, BFS / DFS, binary search, dynamic programming, KMP, union-find, monotonic stack, etc.) with the underlying framework reasoning. The author's pedagogical bet is that learners who internalize the patterns can derive solutions to unseen problems, rather than just memorizing canonical answers. Companion site at labuladong.online; the book has also been published in print.

Key features

  • Pattern-first organization — chapters built around recurring problem-solving templates, not language or topic.
  • "Why" emphasis — the reasoning behind why a given pattern applies, not just the implementation.
  • LeetCode problem mappings tie every pattern to practice problems.
  • Companion site at labuladong.online with refined reading layout.
  • The book has been printed and sold commercially in China; the repo retains the source.

Tech stack

  • Markdown content.
  • Code examples in multiple languages (Python, Java, C++, JavaScript, Go) depending on the chapter.

When to reach for it

  • You're a Chinese-speaking candidate preparing for interviews and want pattern thinking rather than solution memorization.
  • You're a self-learner who's stuck on a specific class of problems (DP, graphs, etc.) and want the framework for solving them.
  • You've read CLRS-level theory and want pragmatic LeetCode-flavored application.

When not to reach for it

  • You're not comfortable reading Chinese — translations exist on the companion site but are not centralized in this repo.
  • You want pure code-reference implementations — TheAlgorithms/Python and similar are closer-fit.
  • You want a license-clean redistribution — no LICENSE in the repo; commercial print rights are held separately by the author/publisher.

Maturity signal

133k stars, 23k forks, last push February 2026 — in a refresh cadence as the author splits effort between the GitHub corpus and the commercially-published book. The 1 open issue count is striking — most reader feedback flows through the labuladong.online comments rather than GitHub. The companion site is the recommended reading surface; the GitHub repo is the source-of-truth checkpoint.

Alternatives

  • donnemartin/system-design-primer — use for system-design specifically (English-language).
  • krahets/hello-algo — use when you want visualizable, multi-language algorithm fundamentals.
  • CyC2018/CS-Notes — broader Chinese-language CS notes.

Notes

The "framework thinking" pedagogy is the project's distinctive contribution to algorithm pedagogy — most resources teach solutions; this one teaches the lens through which similar problems collapse to the same shape. License absence + commercial book existence means downstream redistribution should be cautious; verify rights before vendoring chapters into derivative materials.

Tags

awesome-list, education, algorithms, data-structures, leetcode, interview-prep, chinese, learn-to-code, dynamic-programming