Questions tagged [taocp]

The Art of Computer Programming (acronym: TAOCP) is a comprehensive monograph written by Donald Knuth that covers many kinds of programming algorithms and their analysis.

Wikipedia -

The Art of Computer Programming (acronym: TAOCP) is a comprehensive monograph written by Donald Knuth that covers many kinds of programming algorithms and their analysis.

Knuth began the project, originally conceived as a single book with twelve chapters, in 1962. The first three of what were then expected to be seven volumes were published in rapid succession in 1968, 1969, and 1973. The first installment of Volume 4 (a paperback fascicle) was published in 2005. The hardback volume 4A was published in 2010. Additional fascicle installments are planned for release approximately biannually.

37 questions
3
votes
1 answer

The disjoint set in TAOCP

I want to know if Donald Knuth has covered the disjoint set in his great book ? If so, which chapter is it? Best Regards,
Yongwei Xing
  • 12,983
  • 24
  • 70
  • 90
3
votes
1 answer

how MIX subtractions works with "packed" words

Im reading the Knuth's book TAOCP. And im just learning a simple math operations with registers. And there is an example of subtraction operation: rA before: - | 1234 | 0| 0| 9 Cell 1000: - | 2000 | 150| 0 SUB 1000 rA after: + | 766 | 149 |…
RusAlex
  • 8,245
  • 6
  • 36
  • 44
2
votes
1 answer

Trying to find the Knuth discussion of quotient and remainder

I seem to recall once reading in one of the tAOCP fascicles Knuth's discussion of calculating the integer quotient and remainder. My memory is that he claims it is not possible to calculate one without the other, and that he believed the results…
Jim Newton
  • 594
  • 3
  • 16
2
votes
2 answers

Which volume of TAOCP should I start with?

I have decided to go through "The Art Of Computer Programming" series by Sir Donald Knuth. Based on your experience, please suggest which volume would be a good one to start with, as in an easier one (relative to others) and also, please suggest…
Mahesh Velaga
  • 21,633
  • 5
  • 37
  • 59
2
votes
1 answer

MIX DIV operator, and Conversion of packed bytes number

I'm working through Knuth's The Art of Computer Programming, and I have a question about the MIX assembly language, particularly the DIV operator. On page 133, he gives an example of how the DIV operator affects the Accumulator and Extension…
2
votes
1 answer

Purpose to set to 0 least significant bits in MMIX assembly with memory operations?

In the documentation to MMIX machine mmix-doc page 3 paragraph 4: We use the notation to stand for a number consisting of consecutive bytes starting at location . (The notation means that the least significant t bits of k are set to 0,…
2
votes
4 answers

What does the acronym or shorthand "lg" mean?

What does "lg" mean in the following phrase? "... we ignore the least significant lg t bits of x when referring to Mt[x]." (Knuth, 2005, pp. 4-5). From the context, it seems like "lg t" means "t -1" so that lg 2 would be 1 and lg 5 would be 4. That…
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
2
votes
2 answers

What do the numbers in square brackets mean beside the TAoCP exercises?

Here is an example: [00] The binary form of 2009... [05] Which of the letters... [10] Four-bit quantities -- half-bytes, or hexadecimal digits... [15] A kilobyte... [M13] If x is any string of 0s and 1s... [M20] Prove or disprove... What do the…
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
2
votes
5 answers

Oriented forest TAoCP - Algorithm in python

I try to implement Algorithm O (Oriented forests) from Donald E. Knuth: 'The Art of Computer Programming - Volume 4, Fascile 4, Generating All Trees' on page 24. My Python solution is: def generate_oriented_forest(n): """Algorithm O from Knuth…
foobar
  • 507
  • 1
  • 8
  • 20
1
vote
2 answers

The Art of Computer Programming, Vol 4, Fascicle 2 typo?

At the bottom of page 5 is the phrase "changes k to k ⊕ (1j+1)2". Isn't 1 to any power still 1 even in binary? I'm thinking this must be a typo. I sent an email to Dr. Knuth to report this, but I don't expect to hear back for months. In the…
SSteve
  • 10,550
  • 5
  • 46
  • 72
1
vote
1 answer

Knuth List Insertion Method in C

I've been reading through the sorting and searching algorithms in Volume 3 of The Art of Computer Programming by Donald Knuth, Second Edition. I came across an algorithm which Knuth calls "list insertion" (A modification on traditional insertion…
BlaqICE
  • 309
  • 2
  • 11
1
vote
1 answer

How to understand the algorithm of mysql's gen_lex_hash.cc?

I am reading the mysql's gen_lex_hash.cc, but I don't know the explanation: The idea of presented algorithm see in "The Art of Computer Programming" by Donald E. Knuth Volume 3 "Sorting and searching" (chapter 6.3 "Digital searching" - name and…
abelard2008
  • 1,984
  • 1
  • 20
  • 35
1
vote
1 answer

taocp, sequential allocation questions

i've run into few problems while working tacop 2.2.2 sequential allocations, repacking memory section at page 247. the subject is there are n stacks sharing a common area locations L0 < L < LX, initially we set BASE[j] = TOP[j] = L0 for 1 <= j <=…
lordlinier
0
votes
1 answer

running time upper bound for b-tree

In the Art of Computer Programming, on the bottom of page 485 Suppose there's a B-tree of order m, and there are N keys, so the N+1 leaves appear on level l. The numbers of nodes on levels 1,2,3... is at least 2,2[m/2],2[m/2]^2... (Here [] denotes…
Rui Liu
  • 376
  • 4
  • 9
0
votes
1 answer

Why does the ADD command in Donald Knuths number one program written on MIX set the overflow to ON?

Here is the program: STZ 1 ENNX 1 STX 1(0:1) SLAX 1 ENNA 1 INCX 1 ENT1 1 SRC 1 ADD 1 DEC1 -1 STZ 1 CMPA 1 MOVE -1,1(1) NUM 1 CHAR 1 HLT 1 What I know so far: STZ 1 sets the next instruction to NOP so the second instruction can be ignored According…
Jonathan Harker
  • 78
  • 1
  • 11