Errata for

Errata for
Introduction to the Design and Analysis of Algorithms (-- a Strategic Approach)
by R. C. T. Lee, S. S. Tseng, R. C. Chang, Y. T. Tsai
McGraw Hill 2005
 Page 18, line 13:
Change “8-2” to “9-2”.
 Page 29, line 9:
Change “if k > 0, and” to “if k < 0, or”.
 Page 30, line –6:
Change “

2m  1
2m  2
” to “
”.
m 1
m 1
Page 31, line 6:
Change “ 

1
1
” to “ 
”.
n 1
n 1
Page 33:
Replace Algorithm 2-4 Quick sort (f,l) by the following:
Input: af , af+1 , ... , al .
Output: The sorted sequence of af , af+1 , ... , al .
If f  l then Return
X := af
i := f+1
j := l
While i < j do
Begin
While aj  X and j  f + 1 do
j := j  1
While ai  X and i  l do
i := i + 1
if i < j then ai  aj
End
af  aj
Quicksort( f , j  1)
Quicksort( j + 1 , l )

Page 33:
Replace the example by the following (because Algorithm 2-4 has been
modified):
1
= a1 = 3
a1
a2
a3
a4
a5
a6
aj = a 6 < X
3
6
2
5
4
1
X
j
ai = a 2 > X
6
3
2
5
4
1
2
5
4
6
i
swap a2 and a6
1
3
j
i
aj = a 3 < X
ai = a j = a 3
3
3
1
2
i
j
1
2
5
4
6
5
4
6
ij
swap a1 and a3
2
1
3
5
4
6
2
1
3
5
4
6
>3
<3


Page 40, line –2:
Change “constants” to “constants for n large enough”.
Page 40, line –1:
Change “2p” to “2p”.
Page 57, line 12:

Change “=4  2d” to “=4  2d”.
Page 58, line 11:





Change “2l” to “2i”.
Page 58, line 12:
Change “2l-1” to “2i-1”.
Page 58, line 17:
Change “2l-1” to “2i-1”.
Page 61, line -4:
Change “  c  c(log c)  2.2log c ” to “  c  c(log c)  2  2log c ”.
Page 69, line 2:
2
Change “T(n) = k a log n  n c (
b
k a log n  n c (
b

b
a
)((  c ) logb n  1) ” to “T(n) =
c
a b
b
bc
a
)(( c ) logb n  1) ”.
c
ab
b
Page 69, Line 3:
Change “ T ( n )  nT ( n )  n, T (m)  k and 2 i n  m ” to
“ T (n)  nT ( n )  n, T (m)  k and m  n1 / 2 ”.
i

Page 69, Line -1:
Change “ranged” to “ranging”.

Page 137, line 3:
Change “The first step of constructing the HP is to find the two top elements of
SL and SR.“ to “Let Hull(SL) and Hull(SR) denote the convex hulls of SL and SR ,
respectively. There are two line segments between SL and SR to join Hull(SL) and
Hull(SR) into a convex hull. Let Pa Pb denote the upper segment, where Pa and

Pb belong to SL and SR, respectively. The first step of constructing the HP is to
find Pa and Pb. “.
Page 136, Figure 4-17
Replace the figure by the following.
L
P9
P12
P6
P3
P13
P4
P1
P8
P10
P7
P2
P11
P5
VD(SL)

VD(SR)
Page 136, Figure 4-18
Replace the figure by the following.
3
HP
P9
P12
P6
P3
a1
a2
P13
P4
P1
P10
P8
P7
P2
a3
P11
a4
P5
VD(SL)

VD(SR)
Page 137, Figure 4-19
Replace the figure by the following. (Should delete the tags VD(SL) and VD(SR).)
P9
P12
P6
P3
a1
a2
P13
P4
P1
P8
P10
P7
a3
P2
P5



a4
Page 138, Figure 4-21
Change “b35” to “b36”.
Page 165, line 6:
Change “and add the first element’s” to “and add its”.
Page 174, line 11:
Change “respectively” to “, respectively”.
4
P11

Page 183, line 7:

Change “nXi’s” to “n Xi’s”.
Page 204, Figure 5-40:
Replace the figure by the following:
1
4
2
8
3
0
4
7
5
0
6
3
7
6
8
0
9
0
10
2
11
1
12
5
13
0
Track 1
Track 2
Track 3
Track 4
Track 5
Track 6
Track 7
0
1
0
2
7
3
0
4
5
5
4
6
0
7
8
8
3
9

Page 205, Figure 5-43:
The “2” in the top left circle should be “1”.

Page 243 line5:
Delete “, as n ”.
Page 250, line 3:
Change “xm” and “ym” to “x*” and “y*”, respectively.


Page 250, Figure 6-26:
Change “xm” and “ym” to “x*” and “y*”, respectively.

Page 256, line 3:
Change “formula (1)” to “formula (7.1)”.

Page 268, Table 7-4, redraw the table as follows
-
1
a
2
b
3
c
4
d
-
0
-1
-2
-3
-4
1
c
-1
1
0
0
-1
2
b
-2
0
3
2
1
3
d
-3
-1
2
4
4
0
10
2
11
6
12

Page 272, line 10:
Change “pairs in S and i≠k, then either” to “pairs in S, then either”.

Page 274, line –2:
Change “ (1+Mi+1,j-1)×ρ(rk,rj)” to “(1+Mi+1,j-1)×ρ(ri,rj)”.
5
1
13

Page 276, line 15:
Add semicolon “;” to the end of the line.

Page 277, case (4), line 2:
Change “M↓,8” to “M4,8”.

Page 277, case (4), line 4:
Change ”max{0,(1+0)×1}” to “max{0,(1+0)×0}”.

Page 277, case (5), line 4:
Change ”max{0,(1+0)×1}” to “max{0,(1+0)×0}”.

Page 278, case (8), line 1:
Change ”ρ(r1,r6)” to “ρ(r2,r7)”.

Page 278, case (11), line 1:
Change ”ρ(C,C)” to “ρ(C,U)”.

Page 279, case (13), line 1:
Change ”i=1, j=8” to “i=2, j=8 ”.

Page 280, case (16), line –2:
Change ”max{2, 0, 1, 1, 0}” to “max{2, 0, 2, 1, 0}”.

Page 281, case (19), line –2:
Change “max{2, 0, 1, 1, 0, 0}” to “max{2, 0, 2, 1, 0, 0}”.

Page 281, case (20), line –2:
Change “max{2, 2, 1, 1, 0, 0}” to “max{2, 2, 1, 0, 0, 0}”.

Page 282, line 3:
Change “O(j.i)” to “O(j  i)”.

Page 294, line –5:
Change “we shall first consider trees.” we shall focus on trees.”.

Page 301, Sec. 7-8, line 2:
Change “G(V,E)” to” G=(V,E)”.

Page 302, line –9:
Change “wt(a)+2wt(b)+wt(a)” to “2wt(a)+wt(b)+wt(b)”.

Page 305, line 5:
Change “ C(T (u), w, u, u ) C(T (u), w, u, u) ” to
“ C(T (u), w, u, u ) (C(T (u), w, u, u)) ”.

Page 305, line 8:
Change “ C(T (u), u, w, u ) C(T (u), u, w, u) ” to
“ C(T (u), u, w, u ) (C(T (u), u, w, u)) ”.

Page 307, line 1:
Change “ C(T (v2 ), v1 , v2 , v2 ) ” to “ C(T (v2 ), v1 , v2 , v2 ) ”.

Page 308, Figure 7-42:
Change the figure to the following:
6
v1
v2
2+2+2
v4

v5
Page 309, Figure 7-44:
Change the figure to the following:
(An extra guard here)
2+2+2

4+4
v2
v3
v4

v1
v5
Page 317, Ex 7.2, line 1:
Change “shown in Figure 7-1” to “shown in the above problem”.
Page 317, Ex 7.3:
Replace the excise by the following:
For the graph shown as follows, solve the traveling salesperson problem by the
branch-and-bound approach. Compare it with the dynamic programming approach.
2
1
2
8
10
6
5
3
91
4
8
7
4
3
4

1
2
3
∞
2
10 5
4
2
8 ∞
9
∞
3
4
3
∞
4
4
6
8
7
∞
Page 319, Ex 7.13, line 3:
Change “subsequence S2 from S2’ such ” to “subsequence S2’ from S2 such”.
7





Page 326, line -9:
Change “x2” to “x2 & x3”.
Page 327, line -1:
Change “(8)” to “(4)”.
Page 359, line 11:
Change “8-colorable” to “3-colorable”.
Page 366, line 9:
Change “an 8-coloring” to “a 3-coloring”.
Page 366, line -1:
Change “

0i  m





” to “

”.
0  i  m 1
Page 392, Ex 8.12:
Change “8-coloring” to “3-coloring”.
Page 392, Ex 8.14:
Change “8-dimensional” to “3-dimensional”.
Page 396, line 2:
Change “S” to “S“.
Page 426, line 10:
Delete “induced”.
Page 432, line 14:

Change “i, i+1, …, j-1, and j, j+1, …, k-1 in the permutation” to “i, i+1, …,
j-1 and j, j+1, …, k-1 if k > j or k, k+1, …, i-1 and i, i+1, …, j-1 if k < i in
the permutation”.
Page 436, line -5:
Change “exists” to “exist”.
Page 437, line 6 of the first paragraph:
Change “see,” to “see in Figure 9-38(b),”.
Page 438, line 5:

Change “position of r+1 in” to “position of r+1 in”.
Page 438, in the caption of Figure 9-39(a):

Change “r = 5” to “r = 2”.
Page 439, line -1:

Change “transposition (7, 3, 2)” to “transposition (3, 7, 2)”.
Page 440, the caption of Figure 9-40(c):

Change “and a transposition (7, 3, 2)” to “and a transposition (3, 7, 2)”.
Page 441, line –1:

Change “SOPT  SAPX” to “(SOPT  SAPX) ”.
Page 460, line 4:


8
Change “RC(a, b) + RC(a, c) + RC(a, d) + RC(b, c) + RC(b, d) + RC(c, d)” to




” 2(RC(a, b) + RC(a, c) + RC(a, d) + RC(b, c) + RC(b, d) + RC(c, d))”.
Page 460, line 3:
Change “1 + 2 + 2 + 1 + 1 + 2” to “2(1 + 2 + 2 + 1 + 1 + 2)”.
Page 460, line -2:
Change “9” to “18”.
Change “as the cost” to “as the routing cost”.
Page 461, line.-1:
Change “ n  RC (u, m) ” to “ n  RC (v, m) ”.
u
v

Page 462, Equation (9-6):

Change “2n-1” to "2n-2".
Page 462, Equation (9-7):


Change “=” to "".
Page 465, line -4:
Change "n/3" to "2n/3".
Page 467, Equation (9-16):
Change “mrcst(G)  (2n / 3)  dt (v, P) ” to “mrcst(G) (2n / 3)  dt (v, P) ”.
vP
v

Page 469, line.-5:
Change “i(j+k)+j(i+k)” to "i(j+k)".

Page 469, line.-4:
Change “j(i+k)+k(i+j)” to "k(i+j)".
Page 472, line -9:
Change “Chapter 3” to “Chapter 8”.
Page 484, Ex 9.4:
Delete the exercise.
Page 485, Ex 9.6:
Replace the figure by the following:



A
B
2
5
8
7
6
C

3
D
Page 508, line -9:
9
Change “decrease key(Δ,x,h)” to”decrease(Δ,x,h)”.

Page 521, line –5:
Change “ S xi 1 ”, to “ S xi1 ”.

Page 521, line –4:
Change “ Sx1 ”, “ Sx2 ” and “ Sx3 ” to “ S x1 ”, “ S x 2 ” and “ S x3 ”, respectively.

Page 521, line –2:
Change “ Sx1 ” to “ S x1 ”.

Page 530, case (4), line 3:

Change “increased to i+1” to “increased to i+1 or more”.
Page 530, case (5), line 4:
Change “level i+1” to “level i+1 or more”.











Page 531, Figure 10-44:
Erase the short line segment on the right of (3,1).
Page 532, line -9:
Delete “There are only two operations: union and compression. When a union
operation is performed, the difference between the rank of x and the rank of p(x)
can be only one.”
Page 532, line -6:
Change “However, when a compression” to “When a compression”
Page 533, line –3:
Change “block (i-1, j’ ) ” to “block (i-1, j) ”.
Page 535, line -10:
Change “blocks whose intersection with block (i, j) is non-empty” to “blocks
which are covered by block (i, j)”.
Page 535, line -4:
Change “increased to i+1” to “increased to i+1 or more”.
Page 535, line -6:
Change “increased by one” to “increased by one or more”.
Page 535, line -3:
Change “number of nodes” to “number of debit nodes”.
Page 538, line 6:
Delete lines 6, 7 and 8 (starting at “Let t=A(i,j)”).
Page 538, line –6:
Change “A(i,j)“ to “A(i,1)”.
Page 538, line –5:
10
Delete “=  t 2t 1 ”.
t a

Page 538, line -1:

Change the first “=” to “”.
Page 539, line 4:

Change “=” to “”.
Page 539, line 5:

Change “ n((A(1,1)” to “= n((A(1,1)”.
Page 539, line 10

Change “=6+2” to “6+2”.
Page 539, lines –2, -3 and –4:
Change “m/n“ to “ m n  ”.

Page 548, line –6:
Delete “ D  ”.

Page 561, lines 3, 4 and 6:
Change “c0” to “C0”.
Page 571, line 2:
Change ”<” to “=”.
Page 573, line 17:
Change “a number” to “number”.
Page 573, line –10:









Change “Chapter 4” to “Chapter 3”.
Page 558, line –12:
Change “in Step 5” to “in Step5 is O(n)”.
Page 583, line 2:
Change “are” to “is”.
Page 586, line 2:
Delete “Given a sequence of vertices which will produce Tonl,”.
Page 586, line 3:
Change “let” to “Let”.
Page 612, line –16:
Change “weighted graph” to “weighted graph G”.
Page 616, caption of Figure 12-30:
Change “M i Mi'1” to “M i Mi'1”.
11