The Art of Computer Programming (TAOCP)

Click here

to sign up for The Art of Computer Programming Newsletter,

which features updates on new editions and promotions.

Click here

(photo of TAOCP, 1968–2015, by Héctor García-Molina)

At the end of 1999, these books were named among the best twelve

physical-science monographs of the century by

American

Scientist, along with:

Dirac on quantum mechanics,

Einstein on relativity,

Mandelbrot on fractals,

Pauling on the chemical bond,

Russell and Whitehead on foundations of mathematics,

von Neumann and Morgenstern on game theory,

Wiener on cybernetics,

Woodward and Hoffmann on orbital symmetry,

Feynman on quantum electrodynamics,

Smith on the search for structure,

and Einstein's collected papers.

Wow!

[American

Scientist](https://www.americanscientist.org/article/100-or-so-books-that-shaped-a-century-of-science)

View “historic” publisher's

brochure from the first edition of Volume 1 (1968)

[View “historic” publisher's

brochure from the first edition of Volume 1 (1968)](brochure.pdf)

A complimentary downloadable PDF containing the collected indexes is

available

from the publisher to registered owners of the five-volume boxed set.

This PDF includes the complete indexes of Volumes 1, 2, 3, 4A, and 4B, as well as

the index to Volume 1 Fascicle 1.

Registered owners of the earlier four-volume boxed set are, similarly,

entitled to download an

earlier collection of indexes. This earlier

collection includes Volumes 1, 2, 3, and 4A; Volume 1 Fascicle 1; and

Volume 4 Fascicles 5 and 6.

[available

from the publisher](https://www.informit.com/store/art-of-computer-programming-volumes-1-4b-boxed-set-9780137935109)

earlier collection of indexes

eBook versions

These volumes are now available also in portable electronic form,

using PDF format.

Special care has been taken to make the search feature

work well. Thousands of useful "clickable"

cross-references are also provided — from exercises to their

answers and back, from the index to the text, from the text to

important tables and figures, etc.

Warning:

Unfortunately, however, non-PDF versions have also appeared,

against my recommendations, and those versions are frankly quite awful.

A great deal of expertise and care is necessary to do the job right.

If you have been misled into purchasing one of these inferior

versions (for example, a Kindle edition), the publishers have

told me that they will replace your copy with the PDF edition

that I have personally approved. Do not purchase eTAOCP

in Kindle format if you expect the mathematics to make sense.

(The ePUB format may be just as bad; I really don't want to know,

and I am really sorry that it was released.)

Some non-PDF versions also masquerade as PDF.

The authorized PDF versions can be purchased at

www.informit.com/taocp.

www.informit.com/taocp

Please do not tell me about errors that you find in an eBook,

whether it's PDF or not, unless the same errors are present in a printed copy;

such mistakes should be reported directly to the publisher.

Volume 1

Fundamental Algorithms, Third Edition

(Reading, Massachusetts: Addison-Wesley, 1997), xx+650pp.

ISBN 0-201-89683-4

Volume 1 Fascicle 1, MMIX: A RISC Computer for the

New Millennium (2005), v+134pp. ISBN 0-201-85392-2

Translations of previous editions:

Romanian translation by Adrian Davidoviciu, Adrian Petrescu,

Smaranda Dimitriu, and Paul Zamfirescu,

Tratat de programarea calculatoarelor, V. 1:

Algoritmi fundamentali

(Bucharest: Editura tehnica, 1974), 676pp.

Russian translation by Galina P. Babenko and Iu. M. Baiakovskii,

edited by K. I. Babenko, and V. S. Shtarkman,

Iskusstvo programmirovaniia dlia ÉVM, T. 1:

Osnovnye algoritmy

(Moscow: Mir, 1976), 735pp.

Japanese translation, under direction of Takakazu Simauti, in two volumes:

Chapter 1, by Ken Hirose,

Kihon Sampô / Kiso Gainen

(Tokyo: Saiensu-Sha, 1978), 22+331pp.;

Chapter 2, by Nobuo Yoneda and Katsuhiko Kakehi,

Kihon Sampoô / Jôhô Kôzô

(Tokyo: Saiensu-Sha, 1978), 8+373pp.

Chinese translation by Guan JiWen and Su Yunlin,

Ji Suan Ji Cheng Xu She Ji Ji Qiao, 1. Juan:

Ji Ben Suan Fa

(Beijing: Defense Industry Publishing Co., 1980), 14+573pp.

Spanish translation by Michel Antscherl Harlange and Joan Lluis i Biset,

under direction of Ramón Puigjaner i Trepat,

El Arte de Programar Ordenadores, V. 1:

Algoritmos Fundamentales

(Barcelona: Reverté, 1980), xxiii+672pp.

Hungarian translation, under direction of Miklós Simonovits,

A számítógép-programozás művészete, V. 1:

Alapvető algoritmusok

(Budapest: Műszaki Könyvkiadó, 1987), 654pp.

Translations of the third edition:

Russian translation by S. G. Trigub,

Yu. G. Gordienko, and I. V. Krasikov, edited by S. N. Trigub and

directed by Yu. V. Kozachenko,

Iskusstvo programmirovaniia, T. 1:

Osnovnye algoritmy (Moscow:

Vil'iams, 2000), 713pp

Chinese translation by Su Yunlin,

Ji Suan Ji Cheng Xu She Ji Yi Shu, 1. Juan:

Ji Ben Suan Fa

(Beijing: National Defense Industry Press, 2002), xx+625pp.

Chinese translation

by Li Bomin, Fan Ming, and Jiang Aijun,

Ji Suan Ji Cheng Xu She Ji Yi Shu, 1. Juan:

Ji Ben Suan Fa

(Beijing: Posts & Telecom Press, 2016), xv+517pp.

Polish translation by G. Jakacki,

Sztuka Programowania, T. 1:

Algorytmy Podstawowe (Warsaw:

Wydawnictwa Naukowo-Techniczne, 2002),

xxiv+679pp.

Romanian translation by Mihaela Târpa,

Arta programării calculatoarelor, V. 1:

Algoritmi fundamentali

(Bucharest: Editura Teora Bucuresti, 2002), 616pp.

Japanese translation by Takashi Aoki, Kazuhiko Kakehi, Kenichi Suzuki,

and Takahiro Nagao, supervised by Makoto Arisawa and Eiiti Wada (Tokyo:

ASCII Corporation, 2004), xxii+632pp.

Republished (softcover) by ASCII DWANGO in 2015.

Korean

translation by Ryu Gwang,

컴퓨터

프로그래밍의

예술 1:

기초

알고리즘

(Seoul: Hanbit Media, 2006), 793pp.

Czech translation by David Krásenský,

Umění programování, 1. díl:

Základní algoritmy

(Brno: Computer Press, 2008), xx+649pp.

Macedonian translation by Aristotel Tentov,

Umetnosta na kompjuterskoto programiranje,

T. 1, Fundamentalni algoritmi (Skopje:

Prosvetno Delo, 2009), 724pp.

Albanian translation by Visar Zejnulahu,

Arti i programimit kompjuterik,

V. 1, Algoritma fundamentalë (Skopje:

Prosvetno Delo, 2009), xx+680pp.

Greek translation by Manos Roumeliotis and Stavros Souraklas (Athens:

Tziolas Publications, 2010), 751pp.

Vil'iams

Chinese translation

ASCII DWANGO

[Korean

translation](https://www.hanbit.co.kr/store/books/look.php?p_code=B3301714641)

Prosvetno Delo

Prosvetno Delo

Translations of fascicles:

Romanian translation of Volume 1 Fascicle 1, by Ioan Bledea:

MMIX: Un calculator RISC pentru noul mileniu

(Bucharest: Editura Teora, 2005), ix+149pp.

Japanese translation of Volume 1 Fascicle 1,

by Takashi Aoki, supervised by Makoto Arisawa and Eiiti Wada (Tokyo:

ASCII Corporation, 2006), vii+134pp.

Republished (softcover) by ASCII DWANGO in 2015.

Chinese translation of Volume 1, Fascicle 1, by Su Yunlin (Beijing: China

Machine Press, 2006), 268pp.

Chinese translation of Volume 1, Fascicle 1, by Jiang Zhiqiang and Huang Zhibin

(Beijing:

Posts & Telecom Press, 2020), viii+308pp.

Russian translation of Volume 1 Fascicle 1, by Yu. G. Gordienko, edited by S. N. Trigub,

MMIX --- RISC-komp'iuter dlia novogo tysiacheletiia (Moscow:

Vil'iams,

2007), 151pp.

Polish translation of Volume 1 Fascicle 1, by G. Jakacki:

MMIX --- komputer na nowe tysiąclecie

(Warsaw: Wydawnictwa Naukowo-Techniczne, 2008),

xii+146pp.

Hungarian translation of Volume 1 Fascicle 1, under the direction of Antal Iványi:

MMIX. RISC számítógép a következő évezredre

(Budapest: AnTonCom Infokommunikációs Kft., 2009),

168pp.

ASCII DWANGO

[(Beijing:

Posts & Telecom Press, 2020)](https://www.ituring.com.cn/book/2094)

Vil'iams

Volume 2

Seminumerical Algorithms, Third Edition

(Reading, Massachusetts: Addison-Wesley, 1997), xiv+762pp.

ISBN 0-201-89684-2

Translations of previous editions:

Russian translation by Galina P. Babenko, É. G. Belaga, and L. V.

Maiorov, edited by K. I. Babenko,

Iskusstvo programmirovaniia dlia ÉVM, T. 2:

Poluchislennye algoritmy

(Moscow: Mir, 1977), 724pp.

Japanese translation, under direction of Takakazu Simauti, in two volumes:

Chapter 3, by Masaaki Sibuya,

Jun Suchi Sampô / Ransû

(Tokyo: Saiensu-Sha, 1982), ii+259pp.;

Chapter 4, by Keisuke Nakagawa,

Jun Suchi Sampô / Sanjutsu Enzan

(Tokyo: Saiensu-Sha, 1986), xii+536pp.

Romanian translation by Florian Petrescu, Ioan Georgescu,

Rolanda Predescu, and Paul Zamfirescu,

Tratat de programarea calculatoarelor, V. 2:

Algoritmi seminumerici

(Bucharest: Editura tehnica, 1983), 722pp.

Chinese translation by Guan JiWen and Su Yunlin,

Ji Suan Ji Cheng Xu She Ji Ji Qiao, 2. Juan:

Ban Shu Zhi Suan Fa

(Beijing: Defense Industry Publishing Co., 1992), 10+622pp.

Hungarian translation, under direction of Miklós Simonovits,

A számítógép-programozás művészete, V. 2:

Szeminumerikus algoritmusok

(Budapest: Műszaki Könyvkiadó, 1987), 690pp.

Translations of the third edition:

Russian translation by L. F. Kozachenko, V. T. Tertyshnyi, and I. V. Krasikov,

edited by S. N. Trigub and directed by Yu. V. Kozachenko,

Iskusstvo programmirovaniia, T. 2:

Poluchislennye algoritmy (Moscow:

Vil'iams, 2000), 830pp.

German translation of Chapter 4 by Rüdiger Loos

Arithmetik

(Heidelberg: Springer Verlag, 2001), xiii+538pp.

Chinese translation by Su Yunlin,

Ji Suan Ji Cheng Xu She Ji Yi Shu, 2. Juan:

Ban Shu Zhi Suan Fa

(Beijing: National Defense Industry Press, 2002), xii+760pp.

Chinese translation

by Wu Bin and Fan Ming,

Ji Suan Ji Cheng Xu She Ji Yi Shu, 2. Juan:

Ban Shu Zhi Suan Fa

(Beijing: Posts & Telecom Press, 2016), x+603pp.

Romanian translation by Mihaela Târpa, Cora Radulian, and Mihai Iosif,

Arta programării calculatoarelor, V. 2:

Algoritmi seminumerici

(Bucharest: Editura Teora Bucuresti, 2002), 663pp.

Polish translation by Adam Malinowski,

Sztuka Programowania, T. 2:

Algorytmy Seminumeryczne (Warsaw:

Wydawnictwa Naukowo-Techniczne, 2002),

xviii+820pp.

Japanese translation by Hiroaki Saito, Takahiro Nagao, Shogo Matsui,

Takao Matsui, and Hitoshi Yamauchi,

supervised by Makoto Arisawa and Eiiti Wada

(Tokyo: ASCII Corporation, 2004), xvi+725pp.

Republished (softcover) by ASCII DWANGO in 2015.

Korean

translation by Ryu Gwang,

컴퓨터

프로그래밍의

예술 2:

준수치적

알고리즘

(Seoul: Hanbit Media, 2007), 933pp.

Greek translation by Manos Roumeliotis and Stavros Souraklas (Athens:

Tziolas Publications, 2010), 911pp.

Czech translation by David Krásenský,

Umění programování, 2. díl:

Seminumerické algoritmy

(Brno: Computer Press, 2010), xii+763pp.

Vil'iams

Chinese translation

ASCII DWANGO

[Korean

translation](https://www.hanbit.co.kr/store/books/look.php?p_code=B5813900488)

Tziolas Publications

Volume 3

Sorting and Searching, Second Edition

(Reading, Massachusetts: Addison-Wesley, 1998), xiv+780pp.+foldout.

ISBN 0-201-89685-0

Translations of the first edition:

Romanian translation by Rodica Boconcios, A. Davidoviciu,

P. Dimo, Fl. Moraru, A. Petrescu, I. Sipos, and Smaranda Dimitriu,

Tratat de programarea calculatoarelor, V. 3:

Sortare şi căutare

(Bucharest: Editura tehnica, 1976), xii+736pp.

Russian translation by Nadezhda I. V'iukova, V. A. Galatenko, and

A. B. Khodulev, edited by Iu. M. Baiakovskii and V. S. Shtarkman,

Iskusstvo programmirovaniia dlia ÉVM, T. 3:

Sortirovka i poisk

(Moscow: Mir, 1978), 844pp.

Chinese translation by Guan JiWen and Su Yunlin,

Ji Suan Ji Cheng Xu She Ji Ji Qiao, 3. Juan:

Pai Xu He Cha Zhao

(Beijing: Defense Industry Publishing Co., 1985), viii+645pp.

Spanish translation by Jaime de Argila y de Chopitea and

Ramón Puigjaner Trepat, under direction of

Ramón Puigjaner Trepat,

El Arte de Programar Ordenadores, V. 3:

Clasificación y Búsqueda

(Barcelona: Reverté, 1980), xxiii+672pp.

Hungarian translation, under direction of Miklós Simonovits,

A számítógép-programozás művészete, V. 3:

Keresés és rendezés

(Budapest: Műszaki Könyvkiadó, 1988), 761pp.

Translations of the second edition:

Russian translation by V. T. Tertyshnyi and I. V. Krasikov,

edited by S. N. Trigub and directed by Yu. V. Kozachenko,

Iskusstvo programmirovaniia, T. 3:

Sortirovka i poisk (Moscow:

Vil'iams, 2000), 823pp.

Chinese translation by Su Yunlin,

Ji Suan Ji Cheng Xu She Ji Yi Shu, 3. Juan:

Pai Xu Yu Cha Zhao

(Beijing: National Defense Industry Press, 2002), x+779pp.

Chinese translation

by Jia Hongfeng,

Ji Suan Ji Cheng Xu She Ji Yi Shu, 3. Juan:

Pai Xu Yu Cha Zhao

(Beijing: Posts & Telecom Press, 2017), x+632pp.

Polish translation by K. Diks and A. Malinowski,

Sztuka Programowania, T. 3:

Sortowanie i Wyszukiwanie (Warsaw:

Wydawnictwa Naukowo-Techniczne, 2002),

xviii+838pp.

Romanian translation by Mihaela Târpa,

Arta programării calculatoarelor, V. 3:

Sortare şi căutare

(Bucharest: Editura Teora Bucuresti, 2002), 680pp.

Japanese translation by Yuichiro Ishii, Hiroshi Ichiji, Hiroshi Koide,

Eiko Takaoka, Kumiko Tanaka, and Takahiro Nagao,

supervised by Makoto Arisawa and Eiiti Wada (Tokyo:

ASCII Media Works,

2006), xvi+741pp.

Republished (softcover) by ASCII DWANGO in 2015.

Korean

translation by Ryu Gwang,

컴퓨터

프로그래밍의

예술 3:

정렬

검색

(Seoul: Hanbit Media, 2007), 941pp.

Greek translation by Manos Roumeliotis and Stavros Souraklas (Athens:

Tziolas Publications, 2010), 926pp.

Vil'iams

Chinese translation

ASCII Media Works

ASCII DWANGO

[Korean

translation](https://www.hanbit.co.kr/store/books/look.php?p_code=B2390088475)

Tziolas Publications

Volume 4A

Combinatorial Algorithms, Part 1

(Upper Saddle River, New Jersey: Addison-Wesley, 2011), xvi+883pp.

ISBN 0-201-03804-8

(Preliminary drafts were previously published as paperback fascicles;

see below.)

Russian translation (Moscow:

Dialektika, 2019), 955pp.

Japanese translation by Kazuhiko Kakehi and Hiroshi Koide,

and Eiiti Wada,

supervised by Eiiti Wada (Tokyo:

ASCII DWANGO,

2017), xvi+866pp.

Chinese translation

by Li Bomin and Jia Hongfeng

(Beijing: Posts & Telecom Press, 2019), xii+731pp.

Korean

translation by Ryu Gwang,

컴퓨터

프로그래밍의

예술 4A:

조합적

알고리즘

1부

(Seoul: Hanbit Media, 2013), xxiv+1160pp.

Dialektika

ASCII DWANGO

Chinese translation

[Korean

translation](http://www.hanbit.co.kr/store/books/look.php?p_code=B8068754595)

Volume 4B

Combinatorial Algorithms, Part 2

(Upper Saddle River, New Jersey: Addison-Wesley, 2023), xviii+714pp.

ISBN 0-201-03806-4

(Preliminary drafts were previously published as paperback fascicles;

see below.)

Japanese translation by Hideya Iwasaki, Naoyuki Tamura, Minoru Terada,

and Eiiti Wada,

supervised by Eiiti Wada (Tokyo:

ASCII DWANGO, 2023), xx+708pp.

ASCII DWANGO

Chinese translation

by Xiongxin Yang, Guang Hu, Xihan Li, and Fei Liu

(Beijing: Posts & Telecom Press, 2025), xviii+590pp.

Chinese translation

The Remainder of Volume 4

Present plans are for Volumes 4A and 4B to be the first in a series of several

subvolumes 4A, 4B, 4C, ... entitled Combinatorial Algorithms,

Part 1, 2, 3, .... The remaining subvolumes, currently in preparation,

will have the following general outline:

7.2.2.3. Constraint satisfaction

7.2.2.4. Hamiltonian paths and cycles

7.2.2.5. Cliques

7.2.2.6. Covers

7.2.2.7. Squares

7.2.2.8. A potpourri of puzzles

7.2.2.9. Estimating backtrack costs

7.2.3. Generating inequivalent patterns

7.3. Shortest paths

7.4. Graph algorithms

7.4.1. Components and traversal

7.4.1.1. Union-find algorithms

7.4.1.2. Depth-first search

7.4.1.3. Vertex and edge connectivity

7.4.2. Special classes of graphs

7.4.3. Expander graphs

7.4.4. Random graphs

7.5. Graphs and optimization

7.5.1. Bipartite matching

7.5.2. The assignment problem

7.5.3. Network flows

7.5.4. Optimum subtrees

7.5.5. Optimum matching

7.5.6. Optimum orderings

7.6. Independence theory

7.6.1. Independence structures

7.6.2. Efficient matroid algorithms

7.7. Discrete dynamic programming

7.8. Branch-and-bound techniques

7.9. Herculean tasks (aka NP-hard problems)

7.10. Near-optimization

  1. Recursion

Paperback Fascicles

New material for Volume 4

will first appear in beta-test form as fascicles of approximately

128 pages each, issued approximately twice per year.

These fascicles will represent my best attempt to write a comprehensive

account; but computer science has grown to the point where I cannot hope

to be an authority on all the material covered in these books. Therefore

I'll need feedback from readers in order to prepare the official volumes later.

For example, the following fascicles appeared before the hardcover editions of

Volumes 4A and 4B were complete.

Volume 4 Fascicle 0, Introduction to Combinatorial Algorithms

and Boolean Functions (2008), xii+216pp. ISBN 0-321-53496-4

Volume 4 Fascicle 1, Bitwise Tricks & Techniques; Binary

Decision Diagrams (2009), xiii+261pp. ISBN 0-321-58050-8

Volume 4 Fascicle 2, Generating All Tuples and Permutations

(2005), v+128pp. ISBN 0-201-85393-0

Volume 4 Fascicle 3, Generating All Combinations and Partitions

(2005), vi+150pp. ISBN 0-201-85394-9

Volume 4 Fascicle 4, Generating All Trees; History of

Combinatorial Generation (2006), vi+120pp. ISBN 0-321-33570-8

Volume 4 Fascicle 5, Mathematical Preliminaries Redux; Introduction to Backtracking; Dancing Links (2019), xiii+384pp. ISBN 978-0-13-467179-6

Volume 4 Fascicle 6, Satisfiability (2015), xiii+310pp. ISBN 978-0-13-439760-3

Translations of those fascicles:

Japanese translation of Volume 4 Fascicle 0

by Eiiti Wada (Tokyo:

ASCII Media Works,

2009), xii+206pp.

Chinese translation of Volume 4 Fascicle 0, under the direction of Lin Peng Huang (Beijing: Chinese Machine Press, 2010), xii+432pp.

Hungarian translation of Volume 4 Fascicle 0, under the direction of Antal Iványi:

Bevezetés a kombinatorikai algoritmusokhoz és a Boole-függvényekhez

(Budapest: AnTonCom Infokommunikációs Kft., 2009), in preparation.

Albanian translation of Volume 4 Fascicle 0 by Ana Ktona, Besmira Nushi, and

Silvana Greca, Arti i programimit kompjuterik,

V. 4, Fashikulli 0, Hyrje ne algoritmat me Kombinatoralë dhe

funksionet Boolean (Bitola: Mikena, 2009), 238pp.

Hungarian translation of Volume 4 Fascicle 1, under the direction of Antal Iványi:

Bitenkénti trükkök és módszerek; Bináris döntési diagramok

(Budapest: AnTonCom Infokommunikációs Kft., 2009), in preparation.

Japanese translation of Volume 4 Fascicle 1

by Eiiti Wada (Tokyo:

ASCII Media Works,

2011), x+256pp.

Romanian translation of Volume 4 Fascicle 2, by Cora Radulian:

Generarea tuturor tuplurilor și permutărilor

(Bucharest: Editura Teora, 2005), vii+144pp.

Japanese translation of Volume 4 Fascicle 2

by Hiroshi Koide, supervised by Makoto Arisawa and Eiiti Wada (Tokyo:

ASCII Media Works,

2006), viii+129pp.

Russian translation of Volume 4 Fascicle 2, by Yu. G. Gordienko:

Generatsiia vsekh kortezheĭ i perestanovok (Moscow:

Vil'iams,

2007), 146pp.

Polish translation of Volume 4 Fascicle 2, by Adam Malinowski:

Generowanie wszystkich krotek i permutacji (Warsaw:

Wydawnictwa Naukowo-Techniczne, 2007),

xiv+137pp.

Hungarian translation of Volume 4 Fascicle 2, under the direction of Antal Iványi:

Permutációk és n-esek előállítása

(Budapest: AnTonCom Infokommunikációs Kft., 2008), 160pp.

Russian translation of Volume 4 Fascicle 3, by I. V. Krasikov:

Generatsiia vsekh sochetaniĭ i razbieniĭ (Moscow:

Vil'iams,

2007), 200pp.

Japanese translation of Volume 4 Fascicle 3

by Kazuhiko Kakehi, supervised by Makoto Arisawa and Eiiti Wada (Tokyo:

ASCII Media Works,

2008), viii+154pp.

Hungarian translation of Volume 4 Fascicle 3, under the direction of Antal Iványi:

Kombinációk és partíciók előállítása

(Budapest: AnTonCom Infokommunikációs Kft., 2008), 176pp.

Russian translation of Volume 4 Fascicle 4, by I. V. Krasikov:

Generatsiia vsekh derev'ev. Istoriia kombinatornĭ generatsiĭ (Moscow:

Vil'iams,

2007), 156pp.

Hungarian translation of Volume 4 Fascicle 4, under the direction of Antal Iványi:

Fák előállítása; Kombinatorikus előállítások története

(Budapest: AnTonCom Infokommunikációs Kft., 2008), 160pp.

Japanese translation of Volume 4 Fascicle 4

by Kazuhiko Kakehi and Hiroshi Koide,

supervised by Makoto Arisawa and Eiiti Wada (Tokyo:

ASCII Media Works,

2010), viii+118pp.

ASCII Media Works

ASCII Media Works

ASCII Media Works

Vil'iams

Vil'iams

ASCII Media Works

Vil'iams

ASCII Media Works

The future Volume 4C is currently represented by

Volume 4 Fascicle 7, Constraint Satisfaction (2025), xiv+281pp. ISBN 978-0-13-532824-8

Some "pre-fascicles" are also available for alpha-testing:

Pre-Fascicle 8a (Hamiltonian Paths and Cycles);

Pre-Fascicle 9b (A Potpourri of Puzzles).

I've put them online primarily so that experts in the field can check the

contents before I inflict them on a wider audience. But if you want to

help debug them, please go right ahead.

Pre-Fascicle 8a (Hamiltonian Paths and Cycles)

Pre-Fascicle 9b (A Potpourri of Puzzles)

Volume 5

Syntactic Algorithms,

in preparation.

  1. Lexical scanning (includes also string search and data compression)
  1. Parsing techniques

Future plans

As I continue to write Volumes 4 and 5, I'll need to refer to topics that

belong logically in Volumes 1--3 but weren't invented yet when I wrote those

books. Instead of putting such material artificially into Volumes 4 or 5,

I'll put it into fascicle form. The first such fascicle is in fact

ready now (see above): It describes

MMIX,

a RISC machine that is used in Volume 4A; MMIX will also

take the place of MIX in all subsequent editions

of Volumes 1, 2, and 3.

MMIX

Download the 16 Feb 2004 version of

Volume 1 Fascicle 1 (583KB of compressed PostScript)

(this old version is however no longer being maintained; see the errata below)

[Download the 16 Feb 2004 version of

Volume 1 Fascicle 1 (583KB of compressed PostScript)](fasc1.ps.gz)

After Volume 5 has been completed, I will revise Volumes 1--3 again to

bring them up to date. In particular, the new material for those volumes

that has been issued in beta-test fascicles will be incorporated at that time.

Then I will publish a “reader's digest” edition

of Volumes 1--5, condensing the most important material into a single book.

And after Volumes 1--5 are done, God willing, I plan to publish

Volume 6 (the theory of context-free languages) and Volume 7 (Compiler

techniques), but only if the things I want to say about those topics

are still relevant

and still haven't been said. Volumes 1--5 represent the central core

of computer programming for sequential machines; the subjects of Volumes

6 and 7 are important but more specialized.

Volumes 1--4B are available from the publisher,

Addison-Wesley Publishing Company.

Addison-Wesley Publishing Company

MIXware

The MIX computer will soon be replaced by a RISC machine called

MMIX. Meanwhile if you want

to try out the existing programs for the original 60s-era machine,

you might be able to find suitable software at the following sites:

MMIX

GNU's MIX Development Kit

GNU's MIX Development Kit

JMixSim, an OS-independent assembler and simulator, by Christian Kandeler

JMixSim, an OS-independent assembler and simulator, by Christian Kandeler

MixIDE, another OS-independent assembler and simulator, by Andrea Tettamanzi

MixIDE, another OS-independent assembler and simulator, by Andrea Tettamanzi

MIXBuilder: an editor, assembler, simulator, and interactive debugger for Win32 platforms, by Bill Menees

MIXBuilder: an editor, assembler, simulator, and interactive debugger for Win32 platforms, by Bill Menees

EMIX: an expandable MIX emulator for the Win32 platform, by Daniel Andrade and Marcus Pereira

EMIX: an expandable MIX emulator for the Win32 platform, by Daniel Andrade and Marcus Pereira

MIX/MIXAL in C with lex and CWEB documentation and a source debug facility, by Douglas Laing and Sergey Poznyakoff

MIX/MIXAL in C with lex and CWEB documentation and a source debug facility, by Douglas Laing and Sergey Poznyakoff

David Smallberg's version that can be compiled for Linux

David Smallberg's version that can be compiled for Linux

Dan Taflin's assembler and interactive simulator in HTML and Javascript

Dan Taflin's assembler and interactive simulator in HTML and Javascript

Andras Pahi's updated version of

Darius Bacon and Eric Raymond's open-source load-and-go

assembler and simulator, from The Retrocomputing Museum

[Andras Pahi's updated version of

Darius Bacon and Eric Raymond's open-source load-and-go

assembler and simulator, from The Retrocomputing Museum](https://github.com/pahihu/mixal)

John R. Ashmun's MIXware for the Be [Haiku] operating system, with extended support for interrupts

[John R. Ashmun's MIXware for the Be [Haiku] operating system, with extended support for interrupts](http://www.bebits.com/app/3723)

Rutger van Bergen's MIX emulator in .NET/C#

Rutger van Bergen's MIX emulator in .NET/C#

Chaoji Li's MIX assembler and simulator, in Perl

Chaoji Li's MIX assembler and simulator, in Perl

Ruslan Batdalov's MIX emulator, in Scala, which allows execution both forwards and backwards

Ruslan Batdalov's MIX emulator, in Scala, which allows execution both forwards and backwards

Michael Schröder's instructions for building a real MIX on a little fpga-board

Michael Schröder's instructions for building a real MIX on a little fpga-board

Justin Flude's implementation in GO, includes floating-point ops

Justin Flude's implementation in GO, includes floating-point ops

(Please let me know of any other sites that I should add to this list.)

The MMIX Supplement

Martin Ruckert has written an excellent 200-page companion to Volumes 1, 2,

and 3, intelligently

translating all of the MIX programs into MMIX form.

This booklet is jam-packed with instructive details and opportunities for

self-instruction.

Errata et Addenda for Volume 1

The main changes between the second and third editions of Volume 1

are listed in the

Errata for Volume 1 (2nd ed.)

(335K bytes of compressed PostScript, 80pp)---an archival file

that is not being kept up to date. But thousands of

additional refinements appear in the 3rd edition; you really should

ask someone to get it for you next Christmas.

Errata for Volume 1 (2nd ed.)

The main changes to the third edition of Volume 1, made before

the appearance of Volume 4A in 2011, are listed in the

Earliest errata for Volume 1 (3rd ed.)

(262K bytes of compressed PostScript, 50pp).

Earliest errata for Volume 1 (3rd ed.)

There's also another major list of changes, covering the period 2011--2021:

Earlier changes for Volume 1 (3rd ed.)

(143K bytes of compressed PostScript, 20pp).

Earlier changes for Volume 1 (3rd ed.)

Index to Algorithms and Theorems in Volume 1 (new in 2011)

(14K bytes of compressed PostScript, 2pp)

Index to Algorithms and Theorems in Volume 1 (new in 2011)

There's also a (much shorter, last updated 31 May 2026) list of changes

since the 49th printing was released in 2022, almost all of which have been

made in more recent printings:

Errata for Volume 1 (after 2021)

(109K bytes of compressed PostScript, 15pp)

Errata for Volume 1 (after 2021)

Errata for Volume 1 (after 2021), long form

(113K bytes of compressed PostScript, 16pp)

Errata for Volume 1 (after 2021), long form

Errata for Volume 1 (after 2021), TeX form

(47K bytes of raw TeX text)

Errata for Volume 1 (after 2021), TeX form

Note: You can't run that TeX file through TeX; it imports all kinds of

other files that are private. But if you have no way to look at compressed

PostScript files, you might try reading the TeX code as a last resort;

at least you'll be able to figure out the page numbers on which

corrections have been made.

And there's also a list of changes to Volume 1 Fascicle 1,

last updated 08 January 2025:

Errata for Volume 1 Fascicle 1

(88K bytes of compressed PostScript, 11pp)

Errata for Volume 1 Fascicle 1

Errata for Volume 1 Fascicle 1, long form

(92K bytes of compressed PostScript, 13pp)

Errata for Volume 1 Fascicle 1, long form

Errata for Volume 1 Fascicle 1, TeX form

(39K bytes of raw TeX text)

Errata for Volume 1 Fascicle 1, TeX form

Note: An unknown number of badly printed copies of Volume 1 Fascicle 1

were printed by mistake. Among other defects, the copyright page

has incredibly poor resolution, and the MMIX summary chart

has been omitted from the inside back cover. If you have purchased one of

these monstrosities, the publishers assure me that they will replace

your copy with a good one.

Errata et Addenda for Volume 2

The main changes between the second and third editions of Volume 2

are listed in the

Errata for Volume 2 (2nd ed.)

(555K bytes of compressed PostScript, 142pp)---an archival file that is

not being kept up to date. But thousands of

additional refinements appear in the 3rd edition; you really should

ask someone to get it for you next Christmas.

Errata for Volume 2 (2nd ed.)

The main changes to the third edition of Volume 2, made before

the appearance of Volume 4A, are listed in the

Earliest errata for Volume 2 (3rd ed.)

(229K bytes of compressed PostScript, 50pp), dated 08 January 2011.

Earliest errata for Volume 2 (3rd ed.)

There's also another major list of changes, covering the period 2011--2021:

Earlier changes for Volume 2 (3rd ed.)

(133K bytes of compressed PostScript, 19pp).

Earlier changes for Volume 2 (3rd ed.)

Index to Algorithms and Theorems in Volume 2 (new in 2011)

(14K bytes of compressed PostScript, 2pp)

Index to Algorithms and Theorems in Volume 2 (new in 2011)

There's also a (much shorter, last updated 09 June 2026) list of changes since the 45th printing was released in 2022, almost all of which have been made in more recent printings:

Errata for Volume 2 (after 2021)

(107K bytes of compressed PostScript, 12pp)

Errata for Volume 2 (after 2021)

Errata for Volume 2 (after 2021), long form

(111K bytes of compressed PostScript, 13pp)

Errata for Volume 2 (after 2021), long form

Errata for Volume 2 (after 2021), TeX form

(49K bytes of raw TeX text)

Errata for Volume 2 (after 2021), TeX form

Note: You can't run that TeX file through TeX; it imports all kinds of

other files that are private. But if you have no way to look at compressed

PostScript files, you might try reading the TeX code as a last resort;

at least you'll be able to figure out the page numbers on which

corrections have been made.

Errata et Addenda for Volume 3

The main changes between the first and second editions of Volume 3

are listed in the

Errata for Volume 3 (1st ed.)

(430K bytes of compressed PostScript, 109pp)---an archival file that is

not being kept up to date. But thousands of

additional refinements appear in the 2nd edition; you really should

ask someone to get it for you next Christmas.

Errata for Volume 3 (1st ed.)

The main changes to the second edition of Volume 3, made before

the appearance of Volume 4A in 2011, are listed in the

Earliest errata for Volume 3 (2nd ed.)

(226K bytes of compressed PostScript, 43pp).

Earliest errata for Volume 3 (2nd ed.)

There's also another major list of changes, covering the period 2011--2021:

Earlier changes for Volume 3 (2nd ed.)

(117K bytes of compressed PostScript, 15pp).

Earlier changes for Volume 3 (2nd ed.)

Index to Algorithms and Theorems in Volume 3 (new in 2011)

(14K bytes of compressed PostScript, 2pp)

Index to Algorithms and Theorems in Volume 3 (new in 2011)

There's also a (much shorter, last updated 09 June 2026) list of changes since the 45th printing was released in 2022, almost all of which have been made in more recent printings:

Errata for Volume 3 (after 2021)

(87K bytes of compressed PostScript, 7pp)

Errata for Volume 3 (after 2021)

Errata for Volume 3 (after 2021), long form

(92K bytes of compressed PostScript, 8pp)

Errata for Volume 3 (after 2021), long form

Errata for Volume 3 (after 2021), TeX form

(31K bytes of raw TeX text)

Errata for Volume 3 (after 2021), TeX form

Note: You can't run that TeX file through TeX; it imports all kinds of

other files that are private. But if you have no way to look at compressed

PostScript files, you might try reading the TeX code as a last resort;

at least you'll be able to figure out the page numbers on which

corrections have been made.

Errata et Addenda for Volume 4A

The following corrections to the paperback fascicles that preceded Volume 4A

will make them essentially consistent with the first hardcover printing

of that volume. (These errata files reached their final form on

01 January 2011, and they won't be updated again; see below for

additional amendments and corrections to the hardcover printing.)

Errata for Volume 4 Fascicle 0

(124K bytes of compressed PostScript, 11pp)

Errata for Volume 4 Fascicle 0

Errata for Volume 4 Fascicle 0, long form

(128K bytes of compressed PostScript, 13pp)

Errata for Volume 4 Fascicle 0, long form

Errata for Volume 4 Fascicle 0, TeX form

(51K bytes of raw TeX text)

Errata for Volume 4 Fascicle 0, TeX form

Errata for Volume 4 Fascicle 1

(166K bytes of compressed PostScript, 13pp)

Errata for Volume 4 Fascicle 1

Errata for Volume 4 Fascicle 1, long form

(169K bytes of compressed PostScript, 14pp)

Errata for Volume 4 Fascicle 1, long form

Errata for Volume 4 Fascicle 1, TeX form

(47K bytes of raw TeX text)

Errata for Volume 4 Fascicle 1, TeX form

Errata for Volume 4 Fascicle 2

(100K bytes of compressed PostScript, 13pp)

Errata for Volume 4 Fascicle 2

Errata for Volume 4 Fascicle 2, long form

(109K bytes of compressed PostScript, 16pp)

Errata for Volume 4 Fascicle 2, long form

Errata for Volume 4 Fascicle 2, TeX form

(50K bytes of raw TeX text)

Errata for Volume 4 Fascicle 2, TeX form

Errata for Volume 4 Fascicle 3

(112K bytes of compressed PostScript, 14pp)

Errata for Volume 4 Fascicle 3

Errata for Volume 4 Fascicle 3, long form

(118K bytes of compressed PostScript, 17pp)

Errata for Volume 4 Fascicle 3, long form

Errata for Volume 4 Fascicle 3, TeX form

(48K bytes of raw TeX text)

Errata for Volume 4 Fascicle 3, TeX form

Errata for Volume 4 Fascicle 4

(124K bytes of compressed PostScript, 9pp)

Errata for Volume 4 Fascicle 4

Errata for Volume 4 Fascicle 4, long form

(126K bytes of compressed PostScript, 9pp)

Errata for Volume 4 Fascicle 4, long form

Errata for Volume 4 Fascicle 4, TeX form

(32K bytes of raw TeX text)

Errata for Volume 4 Fascicle 4, TeX form

The main changes to the first edition of Volume 4A, made before

the appearance of Volume 4B in 2022, are listed in the

Earliest errata for Volume 4A

(225K bytes of compressed PostScript, 44pp).

Earliest errata for Volume 4A

There's also a (much shorter, last updated 09 September 2025) list of changes since the 20th printing was released in 2022, almost all of which have been made in more recent printings:

Errata for Volume 4A (after 2021)

(134K bytes of compressed PostScript, 11pp)

Errata for Volume 4A (after 2021)

Errata for Volume 4A (after 2021), long form

(139K bytes of compressed PostScript, 12pp)

Errata for Volume 4A (after 2021), long form

Errata for Volume 4A (after 2021), TeX form

(45K bytes of raw TeX text)

Errata for Volume 4A (after 2021), TeX form

Note: You can't run that TeX file through TeX; it imports all kinds of

other files that are private. But if you have no way to look at compressed

PostScript files, you might try reading the TeX code as a last resort;

at least you'll be able to figure out the page numbers on which

corrections have been made.

Errata et Addenda for Volume 4B

The following corrections to the paperback fascicles that preceded Volume 4B

will make them essentially consistent with the first hardcover printing

of that volume. (These errata files reached their final form on

26 July 2022, and they won't be updated again; see below for

additional amendments and corrections to the hardcover printing.)

Errata for Volume 4 Fascicle 5

(217K bytes of compressed PostScript, 23pp)

Errata for Volume 4 Fascicle 5

Errata for Volume 4 Fascicle 5, long form

(223K bytes of compressed PostScript, 25pp)

Errata for Volume 4 Fascicle 5, long form

Errata for Volume 4 Fascicle 5, TeX form

(124K bytes of raw TeX text)

Errata for Volume 4 Fascicle 5, TeX form

And there's also a list of changes to Volume 4 Fascicle 6:

Errata for Volume 4 Fascicle 6

(149K bytes of compressed PostScript, 20pp)

Errata for Volume 4 Fascicle 6

Errata for Volume 4 Fascicle 6, long form

(153K bytes of compressed PostScript, 21pp)

Errata for Volume 4 Fascicle 6, long form

Errata for Volume 4 Fascicle 6, TeX form

(66K bytes of raw TeX text)

Errata for Volume 4 Fascicle 6, TeX form

Here's the current list of changes to the hardcover edition of Volume 4B,

last updated 16 April 2026:

Errata for Volume 4B (1st ed.)

(186K bytes of compressed PostScript, 25pp)

Errata for Volume 4B (1st ed.)

Errata for Volume 4B (1st ed.), long form

(190K bytes of compressed PostScript, 26pp)

Errata for Volume 4B (1st ed.), long form

Errata for Volume 4B (1st ed.), TeX form

(92K bytes of raw TeX text)

Errata for Volume 4B (1st ed.), TeX form

Note: You can't run that TeX file through TeX; it imports all kinds of

other files that are private. But if you have no way to look at compressed

PostScript files, you might try reading the TeX code as a last resort;

at least you'll be able to figure out the page numbers on which

corrections have been made.

Errata et Addenda for Volume 4C

Volume 4C is just getting started, as stated above. So far at least its first

couple hundred pages are available as Volume 4 Fascicle 7.

Here are the corrections that I've made so far to my master copy of

that fascicle (last updated 01 July 2026):

Errata for Volume 4 Fascicle 7

(99K bytes of compressed PostScript, 8pp)

Errata for Volume 4 Fascicle 7

Errata for Volume 4 Fascicle 7, long form

(104K bytes of compressed PostScript, 8pp)

Errata for Volume 4 Fascicle 7, long form

Errata for Volume 4 Fascicle 7, TeX form

(32K bytes of raw TeX text)

Errata for Volume 4 Fascicle 7, TeX form

Note: You can't run that TeX file through TeX; it imports all kinds of

other files that are private. But if you have no way to look at compressed

PostScript files, you might try reading the TeX code as a last resort;

at least you'll be able to figure out the page numbers on which

corrections have been made.

Rewards

The first finder of any error in my books receives

0x$1.00 ($2.56),

deposited to their account at the

Bank of San Serriffe;

significant suggestions are also worth 0x$0.20 ($0.32) each.

If you are a really careful reader, you may

be able to recoup more than the cost of the books this way,

and you'll be helping future readers too.

0x$1.00

Bank of San Serriffe

However, people who have read the book Eats, Shoots & Leaves

should not expect a reward for criticizing the ways in which

I use commas. Punctuation is extremely important to me, but I insist on

doing it my own way.

Similarly, you can save yourself valuable time by not trying

to get me to change ‘awhile’ to ‘a while’.

As mentioned above, I take no responsibility for errors in the eBook

editions that do not use PDF format. I would soon go broke if I had to

pay for all of them! Such errors should be reported directly to the

publisher, not to me, and you should request a replacement copy.

Please send your comments either by email to

taocp@cs.stanford.edu

or by old-fashioned mail to

taocp@cs.stanford.edu

In either case please include your postal address, so that I can

mail an official certificate of deposit as a token of thanks for any

improvements to which you have contributed.

SPECIAL NOTE TO THE SPEAKERS OF FRENCH AND OTHER EXOTIC LANGUAGES:

Numerous quotations and bibliographic citations found in these books have been

copied verbatim from the original sources. If you believe you have

found a typographic error, you must prove it by showing that the

original was incorrectly transcribed; believe it or not, your language

has changed over the years, just as English has.

Although I'm working full time on Volume 4C these days, I will try to reply

to all such messages within nine months of receipt.

BUT PLEASE DO NOT SEND EMAIL TO TAOCP EXCEPT TO REPORT ERRORS IN THE ART OF COMPUTER PROGRAMMING.

And if you do report an error via email, please do not

include attachments of any kind; your message should be

readable on brand-X operating systems for all values of X.

(Encrypted messages that I get from "gmail.com" are also

gibberish and unreadable without great pain.)

Send PLAIN ASCII TEXT ONLY.

Don Knuth's home page

Don Knuth's home page

Don Knuth's other books

Don Knuth's other books

Valid HTML 4.01 Transitional