DDC THE STATE OF THE ART OF COMPUTER PROGRAMMING. D.E. Knuth STAN-CS JUNE 1976

331092 cl THE STATE OF THE ART OF COMPUTER PROGRAMMING ~by D.E. Knuth STAN-CS-76-551 JUNE 1976 COMPUTER SCIENCE DEPARTMENT School of Humanities a...
Author: Garry Ellis
7 downloads 2 Views 2MB Size
331092

cl

THE STATE OF THE ART OF COMPUTER PROGRAMMING ~by

D.E. Knuth

STAN-CS-76-551 JUNE 1976

COMPUTER SCIENCE DEPARTMENT School of Humanities and Sciences STANFORD UNIVERSITY " -J"Tt"N STATMENT A Approved for public release; Distribution Unlimitod

DDC

A

:1F1 The State of The Art of' Computer 1Frogramming

Donald M. Knuth rWOf 1,01*1110f1 I 8trt l'ord lII i IV'r'::i Iy

ri-1

(: !nj)ut(e' ""C .t.anU'ord,

(aiJ.i l'oruia

qI05

This report lists all corrections and changes to volumes 1 and 5 The Art of Computer Progranuning,

as of May 14, 1976.

;

The changes apply

to the most recent printings of both volumes (February and March, 1975): if you have an earlier printing there have been many other changes not indicated here.

Volume 2 has been completely rewritten and its second

edition will be published early in 1977. made to volume 2, see SIGSA4 Bulletin 9,

For a summary of the changes h (November 1975), p.

iOf

--

the changes are too numerous to list except in the forthcoming book itself. On any given day the author likes to feel that the last bug has finally disappeared,

yet it

made as time goes by.

appears likely that further amendment.:r will be

Therefore a family of computer programs has been

written to maintain a collection of errata, in the form printed here, but encoded as an ad-hoc sequence of ASCII characters.

The author wishes to

thank Juan Ludlow-Saldivar for the enormous aemount of help he provided in order to get this system rolling.

(Some readers who have access to

the Stanford A.I.-Lab computer may wish to consult the change file before they report a "new" error; the file name is ACP.MAS [ART,DEK]. for page if

nnn of volume

ith

j3kOlnnn

(but change the 01 to

nnn is the Arabic equivalent of a Roman numeral); since

control character " tC", "

k begin

kOlnnn".

Entries

B

O

is the

you may rather search for simply the string

The text of the correction usually include- special coder

following the symbol

"

",

for things like font changez, etc.)

The author thanks all the bounty hunters who have rejorted dlf'-",t_e they spotted. the first

'Tereward to fir.t finder of each error is still ^l for

edition and t2 for the second, gratefully paid.

Volume . res ins

rather far from completion, so there is tlenty of time to work all the exercises in volumes 1

-

: and to catch all the remaining errors therein.

This research was supported in part by Nationa.1 Science Foundation grant 14CS 72-05752 A03 and by the Office o2 :ava . Resa.rch contract NXOlh-7.-C-055J. Reproduction in whole or in part is permdttd for any purpose of .he United States Government. 1

The Tirt of Computer Programming

2, 4

;LU

for 'is

hitimcIf I%

t

U.N[K

line 5 hing encoiaragrd

line 10

antiw'r

2

anwerr

new quote for bottom of page We can race our prob'tam. We can arrange such facts as wi have with order and method. -- HERCULE POIROT, in Murder on the Orient Express (1934)

211.

lina 23

VO. -.

EO.

2i,2.

line 3

prove /16 '\-4

4 (boldface)

prov

that /6

2L2W line -1 3n0 ^.

16

3n

ILIt LO lines -3 and -2-7T < 3nO, where 13 or the original vai:r n n,

T

',

I.,

~......

.

.....

t !Ch

,

-~

8

LIiu' ex 25 deeIeItCp 1.5 and Move the I to the P1d

or Step 14

ex 25, change step L3 to: L3. [Shift.] If x-- < 1, set z

.i

9

r-hifted right 1, k +-k.l, and repeat this .t.p.

10

line 15, new sentence

hardware. The idea gn, hark in PrM;rnre to Henry Brij:g., who uscd it (in harIwarr. -v deecinal rather than binary form) t) compute logarithm tablcs, published in 1624.

L,''

line 23

example,

N,4

1

example

12

exercise 40

L

a periil (.) shoulI appear after the displayed equation

2L,

13

line 2 two changes

(i) th, ,,:Ft two liner of p44 shotull be

(i) the (/p) and (p/q) don't iatch each other.

mnv , bark tn p43, otherw;ie the reader will think cxercire 47 =r complete without turning fhe P.aLe.

14

k,.A'.line 20 lff/(2n)

1/12n

ex 15 put FpareF in the firMt matrix, i.e. abc "%' f h e

de.f

'

def

3

I

line 7 after Table 1

16

Shikh-ehich ^.- Shih-Chieh

--. left side of eq. (17)

17

move the k a little left, to renter it

,

line 7 after (26)

1

Shiih-el,,h \,* Shih-Chich

2Ji

line 8 after (26)

19

tie hnlolfare 3 apprarr to he in wrong font (too i-niall)

22'/

14 places

20

chanpe It to i (Homan type) in the notation for Ieta ftinctinn, namely in line i, line 2, line 3 (twice), line 4 (thrice), line 5 (twirc), line 7, line 10 (twice), Itne 12, linc 15.

2,'2

exercise 47

21

in thpl.ayr,iornmala: chanj:e tipper jn,lirc" from n, n.1/2, 241, 2n.l-k to r, r-1/2, 2r, 2rk rcjwrti,.Jy line 3:n -1. IN- r'-/

2-,'/t

lines -3 and -2

22

ranrr the Renaisrance. I'v* during the Mildle Agem.

2L-

line 2

1)63-) A-

2J St i

23

19613-),

between (23) and (24)

series ^.,o4

24

ri. s (cf. (17))

Ali

2l!,1!J

insert new sentence just after (26):

23

S,-e I). A. Znve, Inf. Prof. Lettera 5 (1976), to aprear, for a further generalization.

.iSL!

replace (25) by new equation (25): ) ( (I/(i-z)) " Zkxo(I~k-iI)

2,, 1S'

26

(%*k ) k, m >O.

lines 4-8

27

move ihe copy for each step to the left next to the step numbers (standard format Se e.g. 2 Algorithm V on p )

-,,I!

[

line -4

28

lines 3 and 4 after Fig. ]1

29

).; that "%'e X -hal values, 'we -\ vjlte -we

line 5

,

,dulrilirtinn, the

30 dsht i* r oin, we can unre r-gnificantly

on Chcby.hev's

incquuhaity: '|'he

-A

line after (13)

P),{2.() ten4l

J.1

)42k41)(r) an j(2k4)(r) tend

line 11

C ".

r

A-,

r

3)

32

C (Roainn, not italies)

line 20

33

34

line 5 (two places)

, record

block

V

35

row 5 column 4 of the table I+T -%

2L '.

IT

Fig. 14 in both steps P7 and P6 PRIME[K]

Pr iME [K)

2,'L'.

37

line 4

fix hrokr, type in the

21.2±'

36

( of PRIME[iH] 38

line 9

felelrt the exclamalion point (0)

LI

"1" ex 3, first line of program

X+I

I-",-

2, '/ aturnr'

f EX;

X+I (0)

40

last !ine of ex 18 acmltne that

41

line 5

incert iinre pare after ihe permiol, thit lane*c

,

39

line no. 21 of the program

PERM I ...

ERM I,....

to

narrow

42

t.2-L!I

4itF.elf

line 8

43

"N-,' :tel.

"

2-1L-

top of page

44

lthe "I" ir hrakrn i "1.3.3"

line 14

,'"'L-

45

the 0 ir broken

L,?(

line 16

0. J.,

0A.-i.

2,Y

v

46

line -10

print)

print),

L,-i

Fig. 3(a)

47

48

deleie ihe ftniiy little box whirh appcars betwern "th'il fram top" and "fourth fro

a. L:

just after (1)

top"

49

remove black ,zprrk

.' A

lines -3 and -2

50

tIcile the gentenee "!A there - obtainable?"

bottom line

,i, TOP

'

TOP

3S

(twire)

7

line 3

,L,=.

=-

) -

_ ..:i-.

__

_

=

-

-=

--=-. --.. ---

-.--

-,

-

...-

-

.

--

[

exercise 14

106

line 3: MOVE MOVE line 4: JSJ*+1 AV. JSJ *+1

1,i

exercise 17(b)

107

(Ilsfing awmbly ... section.) (A slightly farter, but quite prepostrro, s, program umsi, 993 STZ's: JMP 3995; STZ 1,2: STZ 2,2; ...; STZ 993,2; J2N 3399; OEC2 993; J2NN 3001; ENN1

0,2: JMP 3000,1.)

exercise 18 add new sentence:

,

0os

the program itself apprarr in lor.ation; 0000-0015.)

(Ilrleq

4

exercise 20

".a'

Fukuoka) L, I

.

Fukuoka.)

exercise 16 line 1

V

(49):

109

A

Ll EIT

1)0

(49); new line just before answer no. 23:

For small hy:o size, the entries ±613 would not appear.

" e.g. the -v4

exercise 6 line 3

112

line -13

113

e.g., the

15

L,2W

exercise 22(d)

114

Sine theo W are irlepcently choww, the

hie

2L5"" iJ, U exercise 23 line 1:

ol... (In ). -Ne f0Oexp(-1-/;())d1, where bi(")

line 4: In n! e7y ^\, line 6: 8310...;

t,!i'L

A

P7 II. i 83100 83724 .;1796* [lth.

116 when is> 2m.

line 5

*I " pro e

Conp. 2 (1968), 411-415);

line 6

,Irv -/T"-/i). Ov* ,ev /7"-),

*

113

117

woull loop imlefinitely;

~algoriahni nrepukt. down (porsihly referr to buffer whiale 1/0 Is in progrcs-); exercise 9

,j(~~i

116

in revers.e, we can :et the inverqr harkwarok, we ran get the reverse of the inverim of he reverse

2i,

TI

exercise 12

1,EE1 ,, line 12 ro(:) "%V

2, h~.

119

120

rq(z):r

exercise 4() should have the following answer instead: 121

(ii) LDA X,7:7(0:2).

A4

new answer

122

13 . I.J. Kle itm an h ag sh own tha t lim n .to 2 o

"n

Ing jf(n ) lin.

o

"

o V'0k~n(p .

['('o appe'ar.]

line -5

Ll COUNT 1

"

123

COUNT and also page 544, answer to exercise 24

'

124

replac-e lite 8.-87 of tlre J11 X pro'rain by STG X,1(QLINK) QLINK[r1 )- k. Thrn rentmbpr lir;ex R,-118 in86-116. Finally delete "Note: Wlhcn Ihe ... a; ihe loop." on p.544.

lines 1 i-i2 change to (with same indentation):

6,N

T"o. If P A A, r ,QLINK(SUC W)]

-

123

k, P .-NEXT (P), and re,rat (hir step.

i. exercise 16

126

li 2: 29Z'\e 2 Z (twice) lie 8:6 4

line -4 insert new sentence (no new paragraph)

F*L

127

[See exere 5.2.3-29 for a fatrer algorithn.)

exercise 1 line 4

, AVAIL

v

Y

12S

-

,t lin e 2 COL (P)

12 9

oN.,. COL (PO)

17=

114:i

change answer 18 (saving space for new answer 21):

the firrt part up to "after 18. The three pritt

(

;

!, (

(ime the rame n 'tr.

,

'

,Mr. --.

1)

,

130

I"" cart lie shortenel ar follow.;. tive columnF 3,1,2, yield respectively

1

"quccze

onto one line)

L- exercise 20

131

new answer

132

.;6 k:

]I - J. * LOC(A[1,1]) * M1(1-I) - inax(l,J), LOC(AI ,JJ) (Such foritiflat have been propn-rl indepenmrkly Ivy many people. A. 1. H crnberg and H. R. Strong have ripgetrol the ,llowihg k-'hm:suonal gzcneralization: LOC (A [I, ..., I]) - (M r (r1)r L. L, -, I t, Lk Aheri- L I LOC(A I..,I)

Z1. For example, i

1

-i), where Ms. . max(I

2j,-kW

18.,Jt). JIBAI Terh. Fbsetlonure Bull. 14 (1972), 3026-3028.J)

exercise 15

i33

remove Lritche. in fira a-d ,;cronl lincr

2I.,1IL exercise 12 line 2 Am

d

~~~L.

134

A[m].

new answer

135

13. (S.niitnn by S. Araujo.) Let miep, TI thros}i. *r4 k- isnclanjgrl, except that a new A in cirp Ti; 0 will point to Ilse ia t no-le victirl, if an). Step

vari. ble 0 tF mtaiz;,i to

mr'pc: T5. (Right branch loue?] If SIR NK (F') 2 or RLINK(P) = 0, ro on to T6; oliherwire iet A e P, P - RUINK (P) an! return to T2. T6. (Virt P.] "Viit" NODE (P), x.et 0 P, anti return to T4' A mmilar proof appliem TS'

hcrcomr

LLOC (T).

to

iE 1 -

V L!C(T).

136

I

r. L

conrirtr

conFit 4"

j,

4

137

exercise I line 1

138

exercise 12 line 2

...

INFO(P2)-! ^N4 TREE(INFO(P2)-I)

Y'Z//

139

exercise '8 line B pn~tnrdcr

plenr,|er "='

140

exercise 7

/

the diagrams for Ci.ae I have two arron.hial in the wrong direction ... the arrows should lead away from a and iown'.'s I

both Before and

After

141

line -8

~~~j

322

32 I.

e>

142

cise 12 iine 5

F (i) - ri,j)., h(i) - j; a(j) ret n(j) - li,j) and h(j) i;

n(i)

*

V

exercise 16

'te ne o Iraring ouat line 2: tit Imne. *Ii: wa .,ave an oriented rujkubtree ^v* the tated digraph it an oriented tre line 5: confiriuration I *hgraph tree line 6: ,ubtree

2,'Zi |), K Krith,

144

last line

H.i)awen and I. J. Good, lnn. Moth. Siat. 28 (!57).: 946-OS6; 1). E. H,

Knuth,

Jq

~ exercise 24 l'ne 2

145

t. L I, Is line of exercise 23, add:

146

(Frtt-2ti rv'alt w.-lite to C. Hlye Saifac-Marie, VI'Arint'dinire des Afattritnmtiriesix 1 (1891), 107-110.)

22.1L

exercise 3 line 3

14 7

2.iZ'3 e-^ercise 10

t

14S

I!) second-last line before exercise 6

thip; line irn't rght-jimfiiril, aild xpac

149

after Ilit rrinicaln

'L bottom line

130

eich.aiil. VNe rihmaat:.l. ftr Giuy 1. Sirele Jr., C/101i 18 (1975), 405-508, anti P. W&.tIkr, Ca(:AI 19 (1075), in .u;'gwar, for htheilr infnrrinaln.] / Nte lisa' therit no rointno hierit~Steele and Jr. in hsis nann./

Slines 19-21 replace by

Ii'

iS)

Several

br'awuifi I.,,a-cappyin Ar~nrithin hhutril make subatially weaker i.ct rrre-nttiann have lurnsa ,1cviwid. See 1). W. Clark, CACAI 19 (1976), to aprar, antl JI Xf Robcon, C/)CA 19 (1970), to appear. .1-usnvitic abonmit

line 4

minisu,,r N4mnz~u

132

-

2. ,L!

-~

-_

line before exercise 34

-

-

153

165.] I 165. Ser alro L. Wegbreit, Camp. J. 15 (1972), 204-208; I). A. Zavc, Jnf. Proc. IALeerz 3 (1975), 167-169.)

line -7

2,,LIitL det. (A)1 'e

14

,et(.A)

in several p!aces

;ULIV

155

• to .. . in the dcfinitionr of r upper k, x !owcr k, it factorial, and Stirling numlerc of bothkmdni Change

L 2 I

bottom line

156

give rectien reference 1.2.5 in right-hand column

ii.1U1[i !J -.

definition of Beta function

157

line -20 (the entry for 1 degree of arc)

138

B

L T 1154 e"

I Iis

insert new paragraph after line 7: See the Nnxwc rnnctanl.

,

9 -"2 9.

159

to exercire 1.3.3-23 for the 40-digit value of another fundamental

last line

160

161

t /LW Araujo, 'Satln, 560.

163 Bigr,

I 14inry, 20.

164

LI.-15L Boizano entry

163 Carlyle, IhnmOF; 1vi.

166

L2.I LI L! CIorsiic Mallawar., D).mr Agatha Mary Ctarima (Mmiler), xix.16

CI s ih-Clid, 52, 58.

Ll Clark, l)ntjggI.

t

IJ263

We'lls, 594.

L2.WChebyshev's inequality entry 2111l p. 102

A

169

9

S170 lDa,nn Rerel, 57/8.

171



;

Sir Arthur C nan, 46 .3. Donyl,

f

["vrn, Shimon, 239.

173



:

Flye Samnte-Marie, Camille, .580.

174

lti Z1 elvhirFiclrr, David Allen

Llq

Hamlet, P'rince of

D)enmark, 228.

entry for Good. Irving John

•''

176

adld p. 578

F7

~line -8

-

l': .r, "v __

exerwe

1'

Kleitman,Iarth J.. S

178

.4I

_173

&~Et Knapp entry

179

Krogdahl entry

~E ~

/so

fix bsrokcri tyr

~~ ~line "0 N

18

20.

ZLJILI182 =

1incko,~ V. S., 470.

Pathalnia 399-40or.

fl'fI, Joan.ra, Fri-rtir,

OLS.

L

183

Phuicn 1:Z000, 120.

-"L* Pnirnt, Ifrreodr,

L186

i

HCA 601, 120.

'1

188

t 61-ft Renherg, Arnold leonard, 556.

,.tA

189

Robson entry

add p.594

190

Z1 Shakespeare, William, 228, 465.

I

L191

)-I

dele Shih-ehih, Chu entry

ii

192

Steel(- Jr., Guy I,ewir (-Quux), 594.

193 Strong, Hovey Raymond, Jr., 556.

Tat'jan, Robert Endre, 239.

Wadler, Philip lee, 594

,

last line

196

delete "theorem," (raver one line)

25

197 Werbrett, EhtIengr, 603.

Ww,

I)avid

Stephen, 434, 595.

L199 Zave, i)errk Alan, 90, 603.

L

(namely the endpapers of the book)

200

dlh'te "Table 1" alo make the change Fprclfied for page 136

/

line 4 of the Preface

ryltVin IN.s

1,

L

ryct.In1A

line 4

forcing himelf

,bK onrwer

202

V4 being encouraged

line 10

203

anu werK

~ raige ti,

201

'lu~tration about 3/8 inch

~(LU204

F

A!

making the quotation format more consistent

205

line 5: The Prince -% The Prince i line 10: MASON (The Case ... 1951) -V MASON, in The Case of the Angry Mourner (1951)

new exercises

,"_t

206

21. (AI25] (G. I). Knott.) ,'how that the permutation n,... n is oblitable with a staci:, in the sniste of exerrire 2.2.1-5 or 2.3.1-6, if and only if . Cj 1+ifor I < i < n -n the notation of exrrerie 7.

ZZ. (M28] (C. Meyer.) When m is relatively prime lo ii, we know that the sequence (m imol i) (2ri moil it) ... ((n-l)m inil it) is a periutation of (1,2...,--1). Show that the number of inversions of this permutation can be expresse in terms of ])vdleki sums (cf. Sertion 3.3.3). line -9

, 4.588A5

v

1, T

207

45855

lines 5-8 after (38)

208

Curiously ... s aituation to the d\,4 An interf'tuni one-to-one correcponlence between such permutation, anl loinary t ree, more ihreet than lhe romiidabout method via Algorithm I that we havei usel here, has been found by i). Rotemn (Inf. Proc. Ietters 4 (1975), 58-61]; similarly there is a

insert new sentence after (53):

Z,1

209

Actoially the 0 Irni here should have an extra 91 in the exponent, but our manipulations make it clear that thi, O would dis-appear if we had carried further accuracy.

Xz

exercise 28, three changes

the average is sortll1!

"

2,171; ...

\,

for Fouic

210

the iverage lI I, ohsire

reason,

gsorting,"

Ns, "/.) 2./T. I. A..ierp

and II. F. lo;an have

lurovril

that limi infii.0o

ln/ViTi > 2 (to appear).)

'7

-

~ ~ ~ ~

, 2-----

-

-

-

figure 9 step D3

,2Z' -

COUNT [Kj] -%-

COUNT [K1 I

' AI!1'l/

addition to step B2

(if BOUND

1, this means go directly to R4.)

1,2-1

line -5

th ie

211

212

213

,rline F.hlmldn't. be b~roken,

1 L .' BOUND

comments for lines 14 and 15 of the program BOUND

-^"

line 9

,.i

214

21.

(-i) ,nbhrr, 197/4).) 1%-' (19704, 287-289.)

line 8

,

216

Ig:

In, -N

exercise 15 line 2

, Z2...,

217

an raperpciriptr are in wrong font

sulsrrtpts

,2."LL2t

line 1

218

L LL.

line 3

219

rIS

V

rli

=4

L2i.

line -18

Slast line of Th4ble 2 179 -Nv4

LII

220

221

170

line -2

222

wise, oracle ^V4 flangerous, adveritary

LtM! lines - 13, -12, -9, -8

223

prn~rnncrg~,,~ N~outconmrs (four C11211gc"

AV- lines -7 thru -3 oracles".oracle

advecarics. ad~versary (five changrit)

224

4

-7

z",L~lb lines 7-23 mnust be replaced by new copy:

225

Conistructing lower bounds.

Taicorczn %I &showFthat lihe "infoartiation thieoretic' l ow( r linil (2) ran lie art it rarity fa r f romn life trial lower liniml; tis lii Ite Irtecu ii iie ma -r to pirove' Ihenoni M gi-4 uc another way to ilicrover lower liniik. ; a. proof teclinitili' is often vieweil as ft, creation of an admorsary, a rcrniciats iraiig who tnics to make .alvormcrnic rim dowly. When anl algorithin for amesrging i-vmii're it) coiiparm Ai : 1 tile ailva','ary ilete'rinite'; tie fate of the ronmisarimi a. ar to force life algorithm olowni the more dliffir'tt patth. If we canl invent a sitiable aihverary, as int the proof of Theorem M, we Carl eiiire ft.-it every vatiil mierging algorillhm will have to make a rallier large mnsmber of cninplarion. (sonme propte have iieril Life wore onracek' or 'iemon' instead of 'adlver.sary'; li it is prefferable to avouil Fsch terms in thmic context, since 'oratcle%' ha~c Clifits, a oliffer'nt m'onnot at ion in t he Itheory of rcmirive fumitious, amid 'elenmii' appear itt, st ill a iliffa'rent p'iic-s within languaage for artificial intetlijgcnee.) We s-hall make time of coanstramued adversaries, %lance power ic limited with rvgardl to tilie oitcnies of certaini conipart-nio. A mrigismg nictlmodl whih a, itier tile influence of a cotiutraiii". ail'.ercat m otimn know a.ubout tisp eoiu't raiinte to it mmmiti make tile nrcme-ary crampa1risn even thonugli their Oltomies hiave bem'r: jarril"'.me .. For example, mnour proof of Trori c i'oiit rainedi A alos"r lay comhitsmn (5), yet tie mincai:ng *Agoritihan, was uammab1te to make ims of flitfil in fu't ric.r to avoidl any of thle comnparimc comnt raumntc that we shall tire fit tile fnllowinig dliscusgsi apply to tife left and right cns of tife fils. Left constraints, are s-ymbolizel bay

'The

~L ~ lines 7 and 16

226

quti.ctionc -v4 coampar .nn; lie aniwermil -,' recult in

S,11 oracle dV

S,&.1"

lines 9, 10, 18 adversary

t L,L

(four changer.)

line 12

lhen we di-rfle

line 15

227

226 litle,

229

line 18

, the orache

orac:e

lie

*

Z

,

lines 2, 11, 16, 20, -9,-6

\,4

, LI

adversary

(IWx

231

changes)

line 1

ORACIE ^-.

232

AI)VRSARY

line 4

, its I-

230

233

hir,

.'LL[Z

exercise 10, line 2

oracle ^v*

234

adversary

exercise 23, line 6

. .. Ll oracle ^v4

295

a'vcrxary

S32 J! line 2

236

oracle i; aske!fI"

aIIvercary is about to ,lcrile

line 3

237

The oracle

N

I.AL

lines 5, 11, 20, 24, 27, 30

Say ".

Dec-de

lie.

23S

(six chaniger)

51]

,,.2Z

line -2

239

"nracle", -^v4 "a.lversary" ar .n .

I"!3I 5.3.2,

240 line

13: fending an oracle e conkiructing an adversary line 15: oracle tirlare A adversary cause lirA 17, 20, 23: orarle ".' adversary

L,.

replace the eight lines preceding Table 1 by:

may '!p xsuliet in luriber jimrnvrmnr. off hy :2whe.n it 7.

The art tlhat V4I(7)

241

10 -hows that (11) is already

A fiwrly gnni lower bnduI !nr the celection prni.kn h~a, lenr obtained by Davidl C. Kirkpatriek [PI,.). threcc, II. of Tnronio, 197], %ho rnnarutrtle a.. adverary which proves that V'(:a) > ' O(j 2t-1. (12) Kirkptrick hac ako ciahlrhrI the ex.t lchatmr Orn t-3 by Fhowing that V3(n) it r1g((ia-1)/2.5,)1

rl~(nj,-1)/4)1 for all n > 50 (cf.

-terlc(e

22).

242 line 17: A. Sclh'inh ace line 18: la; iiave line -1: (12) (13)

*M.

Paterson, N. Pippenger, and A. Srhiihagc

1! L-V

243

line -7: (13) * (14) line -5: V (n) -e' Vt(n)

b, line -21: a houinogrn.'us -N . n ohlirinas line -2 and -1: a hnon;ngenrorm .an nblhvioa any linmntrnim I, , any nblivinas

244

245

lines 5-6

,tL!

a suitable oracle.] ^.- an adversary.)

"'NI

246

substitute for exercise 22

22. [24] (Iavid (. Kirkpatrick.) Show that when 4.2k ( l-I ( 5 "2k, the upper bound (11) for V.i(n) can he rtluced by 1 ac follnwx: (i) Form four "knockout treer" of ize 2k (ii) ind the minsinin of the four ina ima, ani ,hrcard all 2k el,,menL of it., tree. (im) Using the knowno iflnrmatinn, build a inigle knockouit tree or. size i--2k. (iv) Continue as in the prnof of (11).

247

caption

,

W,,

A inovingennur -"./* An olivinus,

248

line 3

, 1972),

Chapter

QM-

1973), 163-172]

IS] I,

249

upper left corner of Fig. 51

ther::'a clot inising on the reco,,i line of the diagram for n-6

I

230

line 3 new sentence

A. ,:. Yao ani F. F. Yao have pr.oe that A(2,n)

C(tn)

c

r4.,i andi

that .fM(mn,)

.4n

ig(riv1) for in ( n (JACH, to ap.'.ar].

SL;S'

251

line 12

16 is in the wrong hol-fact font

,

,

RECORD (0)

__-

232

line 13 V

RECORD(0)

-

~i..g

line.1

delf-Ii,a: ... roiion of vol. 2

tiLa u'

4.i."%nce

the proof of that throrrm

iF bring rhange'l in

line 6

other 1. .

~i

253 thle r-econd

234

M"h:er P.]

line 15

255

to C~jif M> .

t C.N'

~~

lines -16 and - 1526

sonTlO -N'SORT10 SORT01 -N.- SORT01 ~.

"i

bottoam line

237

~L SoJ""I

A'

~

ij~.258

onicminrary formn of the "Soum;'lrx"

7.239

E&:L

I'mne 17: formmaslatell -Ne

roirtzc-,7r.

httvw6 M-20: smercely -. He.ahionr -^" .pproximr.-Iriy ~drioprmnm.a to I/11. (Tilt PsymoIh0ir' of lImnese O1-1n, .:Hniighlto, Ni1ffian, 19M!); Ilumrin Behavior wed thme

Prinigdipe of ILost F,*fora Ha't~

~~iiU~ LrA/2. I-

extra annotation on line 08 of Program826 LrA/2J. (rX cIhangrg [on)

:4 1U

line -7

only all ",,-

only if all

,4,L I L

line 13

betwern '"

262

betwen antl nutmide the extreme values nf the

L

=

261

(6)

1 Al

,i/

-iY 66. \4

exercise 45

315

exercise 66

316

,66.

new exercise

E,

317

67. [A125] (Andrew Yao.) Prove that all . e,-jie,,ittatio NeIM,.

of

exerie 62

minr'cr-fqi

, LONGITUDE

-at, tIy

the inpiality C, >

.. rrh iaiker exactly k proh:,

i

4.~,

chaemps in the

1/(l-a)). [Ilinu: Show that an

with prolZha)lity 1)k

lines -10, -8, -6 ^,4 LONGITUDE

iigle-ha!;m/ihg
l

k>0

iner -6 andl -5: the right ,itreec of ... ansi the re.,,lt I

1, L7Ti

the refut

new answer

352

30. Thi.i hia. been prov,', by R.mirIl Wcnhcnr [to appear].

S.67l"

353

replace answer to 36 by:

36. Sce A/C Trrh. Arino. 69 (M.I.T., Noveinber 19T), 41 pp.

B_, L-' ' *

334

exercise 19

the foorth rectangle in [ih left-han'l figiure ic tn diort -- it should he extendri ro that tr boltomn line ir at the rame level ar lite bottom of the first a,,I th,;r, rectaiglcr;

I, 1

It may be

answer 20, tho line following the tree should become: ,lffireilt to imrrt a nrw nodue at the

extreme left of thi-s tre.

answer 30 line 4 lefu ,ubtree of that " .e

iV.

356

-ubtree rooteId at that

337

',VU, new answer

29. Partial r-l,,tion by A. Ya: With, N ) 6 krys tie lnwrgt level will contain an average of e notles, .(NI) two-key ,oirc. The average total number of na,l es 'N-I) ,o-key betwren 0.0N and 0.79N, for large N. [/l(an iforinnticn, to -,ppear.]

,47

4 new answer

1,L7 -

4

338

~31. lice anearly baclatirrd Irce, with itlelict inal ticpar ;crci cks for lite Ideeci Part. Plas a1 Clarwk of pa. I lintivl bealanc-e factor adpiminlnts alnng tis pathc. lEach inceni con lnes .1 kocarcel ciaccaccubr of the ljatc'rs) exercise 4 line 3

L LL1

IONiC

TRASH

\-""

..- vnI\-

359

fir

ccacri". ceew 4centricr All 1.1%1l inie: in:*:;; reaa le 4')-plare pirkcicig Is litie to J. Sent Ficle h :Ii, w..Io s.icnure th at 411piaerc don aint '.aafrcre.]

L new answer to exercise I1I (ext ends t o p. 633)

zj

.

360

cccttlce km~s 11. Nn; rhinaact eca a no-l %ella ncely ace - itpt% feclt rve wall "forget"C nice of Ih icanicpl y cibi nc. 'Ii uncle a ccneie, it c.slecl ie rt-placed! iy ane of its terminial .Iecceacclaic11c1 e.g~., lby sraclccug to lice righ lizciaever pa..cible.

i~~exercise 12 1lc11 31:Ai-irclcin (..I\lact line:

: ,L LL 1k2)A)

.L

361 th

grcitm gn Aij!j!c%I4'e an the pre~ oaS icj-

r

SV

exercise 34 line 1 A

362

1k2(k-1)

exercise 34, new answer to part (b)

363

(11)lie Icv 1/fer'. ) part, of cce(fa'rc to rnticcir vaier c f j itilli 2 Ira i. For I < r < 2 Ir a e.i-'e~k e' xl r t,-frlit). For r %r~c have ZO(knI

S.LdL

line -9

W

364

01

17.L

new answer 39. Sce Miyakawa,

V

Ytiba, X1,g1ta, awul linoii,, SIAM.~ i. Conipuling, to apprar.

line 12

~.'~ ani

363

Witj,

366

0/0

1 whis k

it-lti . 1,'iljii t~t , I wilt r'.lc a flew .ippraurli to td its

S~ ~

MIike I'.~vsrsAa

formuitr):

(1)

N U)

(t o

F-inii'Iifst'.

eac)b 369

answer

I'k

4

IkI

370 thenf C F* -k>t

-7k an"l

)kniaz (,l(-iA-)A)

line 1

~Il)it r-q

37' I t 111C tlhr proviiity

1%urt (N-V..)/ 'i

~~.

IIoiIig

n ata ~ar). ppet

'new

.M it

jaenwrrc,

new answer

45. Y.Set, I-.

ii

r ei eraiI of i

368

line 6 (foiurthl. ine oftiplarde

67. Let

A-I, anti

exercise 39

ZL5LL

~S~

N

hreV.

tha.i

ta

a.itla~mIr tso-udt v: i

triie Amrp",

krJ

line -20 last column

372

Ik

after Nne 7, a new paragraph:

, fi

373

A frw inrererming enu ,i.IemInwith-ii. t C irnlnnm riner have ari',, in cnrIer e t inn with the analyiR of Inr lltg and crarchmi,: algnrith,.ws; .I-,igt alucr of thire, eons.tant. appcar in lthe atiqwer in xercriFer 5.2.3-27, 5.2.4-13, andi 6.3-27.

7/1iL:,

left column

374

ilet (/11

J'V eI(/) C

E ,,1 IUL

line -2

375

Z.':LI /

definition of factorial

376

1

n

"2 "-

,

/

" ,

1 2 ".. n

definitions of x lower k and Stirling numbers of both kinds

line -12 .5.1.3. I\0

37

378

5.1.3

Atlhrr.ari.e, 20-201, 209, 211.-29 220.

.7'.I" L Aho entry adh1 p. 468

___--

3.90

Ria.eil, Gerard, 0.40.

71.2.L

382

Bayer, Paul Joep, , 0, 150.

I.Vi LL

383

Fell, Wah , 52.

FIihrn. J.1011 Scot, 680.

10 2.L Fredman entry

3S7

•stIll pp. 12 ), I'l

33 (;rac--rh 'Nl

Gracrilh

, 2.LL Guibas entry alt pp..52". h!2, 696

389

M

E

i390

H a i Ierbert r 541 .'

!i

f1.ir..nrii, 687. '

drieg.

Iac eliry for "llninInq-nri, cnanpaa..nss"

,2kTL Hyafii entry

.93

d',, p. 215

, , '

L two new entries

if| [Ik treeri, 468.

24.*'

394

lit-IjhnnrI trre, tfr, 468, iee Ralne-,i Irre.

Knockout tournament entry

395

a,d pp. 214, 220

', Linear list representation entry 4 '2ItL 468. N

,96

471.

,S.'LL two new entries Karle111, Ph1dap |x'-ic' 168

K rkpatrock, I)D,.il (;;rr, 215, 220. 636.

l.,oran, lRenpini

Franklin, Jr., S913

.97

Meyer, Curt, 22.

400 N ,ykawa, M aali ro, 687.

401

5,_ t L Olivioiss algorthim,

220-221.

W

)-

."'

L402

Orach.A, 200, xre, A1vvrsarim

403

2L Parallel computation entry 7,,"/ add p. 640

404 llafvrnn, Mihael Stewart, 217.

405

LF L Piplwi,'ier, Nirhola. joln, 217.

F,'2 L line -1 78

-

406

vi, 78

71

407

Rot in, l)ornn, 64.

3,')

40

Sherp, Lawrene Alan, 594.

Sline -7 223,

409

223, 405 (execise 22),

410

~IL~ Silver, Roland Lazarms, 576.

:?,i""WU

Simultaneous comparisons entry

411

add p. 640

7Y

"ll

L412

StCV4rnn, DaVIdI, 640.

.',WXLnew subentry under Sorting

413

hi:sIori of, 382-3118, 417-418. 414

415 Siugitn, Yncin, 607.

416 Sz.cnerieli, Vndlrc, 528.

417 'Ipe arrhtnp, 41(10-401, 40.S.

~'Z.U.~line 2541 Av~SItwomir ~law~iii

'C'revc~nrt, tee Trep s'etian

ort, IfiajwOt.

420

'tL

STurski Wkidyh~w

entry

421

,.,4 Wh~ldy~Iiw

~ i 6 Luirnan ery422

i."Lnew subentry under Thie search

423

424 Wrcqii(r, Rnwil, 614.

1:1 " 117 Yan, Fnoij, Fraricr, 232, 422.

425

' at1, p.

,

426

Yao, An6rew entry

427

(6

., ,

'

Wrench entry

ad lip. 232,422, 479, 549, 678

Z• ,

-

L42UO

',

Yuha, "'ndii1ugiu, 60;. 1a,429 Zeta f inril ion, 612, 666.

430

just before 2-3 trees entry

,.'~t

re;,.b, 545 570.

,"Z' .'i

431

(namely the endpapers of the book)

dehte "Table 1" alekn chang, I in italic I in

t',L

windiemlwr 35

432

changes to MIX booklet

16O, Fit,. 3: Step P3 ,inidlI -aiy "500 fninl?" p34, Fipl. -1: ih.,i raiii ,lnul &jyL EQU

0

3

00667 14 , hlio 1: 001i/ '\-* 43 , hli. 2:193,331 ", 133,13t p04, prbilrin 16, lin' 2: row... haiial I.104, lrololvn 16, line 8: 10 IN.- 9 anil

hanife "reroril" in

"hln,'k"

row ani l mnunin

evrrywhere url the ohxriu-ion of MIX

5-

1/0 nprrators.

'LV

changes to the book Surreal Numbers

p1 ,qIn 2: (4) '\

(3) pill1, lii,; 4 awl 5i, I ittrrilif QA

r117,

*-t

3 _

*1

Injehe

nIlle of liclt, 11,14-r:

3

pirri Itin 18, hiima'. 3 awl 4 41ilaId 1w:

571

433

BIBLIOGRAPHIC DATA SHEET 4. Title and Subtitle

1. Report No.

12.

3. Recipient's Accession No.

STAN-CS-76-551 S. Report Date

6.J

THE STATE OF THE ART OF COMFUTER PROGRAIMING 7. Author(s)

june 1976

D. E.

8. Performing Organization Rept. No. STAN-CS-76-551 10. Project/Task/Work Unit No.

STANFORD UNIVERSITY COMPUTER SCIENCE DEPARTMENT STANFORD, CA. 94305

11. Contract/Grant No.

MUTH 9. Performing Organization Name and Address

NOOOIk -76-C-O33O

12. Sponsoring Organization Name and Address

13. Type of Report & Period Covered

Tena Technical

Office of Naval Research Department of the Navy Arlington, Virginia 22217

14

15. Supplementary Notes

16. Abstracts

This report lists all corrections and changes to volumes 1 and 3 of The Art of Computer Programming, as of May 14, 1976. The changes apply to the most recent printings of both volumes (February and March, 1975); if you have an earlier printing there have been many other changes not indicated here. Volume 2 has been completely rewritten and its second edition willbe published early in 1977. For a summary of the changes made to volume 2, see SIGSAM Bulletin 9, 4 (November 1975), P. lOf -the changes are too numerous to list except in the forthcoming book itself.

17. Key Words and Document Analysis. 17e. Descriptors

17b. Identifiers/Open-Ended Terms

17c. COSATI Field/Group

18. Availability Statement

Approved for public release;distribution unlimited.

19. Security Class (This Report)

21. No. of Pages O

20.

22. Price

Seeuriy

Class (This

Pa~UNCLASSIFIED FOnM NTIS-35 4iO-701

# Y'.0 USCOMMk4-OC 40329-P71