算法导论(第二版)勘误表

合集下载

《编译原理》(第2版)勘误表

《编译原理》(第2版)勘误表

《编译原理》(第2版)勘误表2008-8-311、第2页倒数第2行改成:分隔单词的空格通常在词法分析时被删去。

2、第3页图1.2改成:3、第16页倒数第9行开始的那段改成:上一节提到,字符串集合由叫做模式的规则来描述。

正规式是表示这些规则的一种重要方法,因此本节围绕正规式来介绍记号的描述与识别。

在介绍正规式前,先给“语言”一个形式定义。

4、第18页表2.3的第4行第4列改成:ε肯定出现在一个闭包中5、第26页图2.10上面的那段改成:ε-closure(T)的计算是从给定的结点集合出发,在图上搜索可达结点的典型过程。

该图只包含NFA的含ε标记的边,T是给定的结点集合。

计算ε-closure(T)的简单算法是用栈来保存那些边还没有完成ε转换检查的状态。

图2.11描述了这样的过程。

6、第43页倒数第5行第一句改成:正规式可以描述的语言都能用上下文无关文法来描述。

7、第61页5行开始的那段改成:(2)仅使用FOLLOW(A)作为A的同步集合是不够的。

例如,分号在C语言中作为语句的结束符,那么作为语句开始符号的关键字没有出现在表达式非终结符的FOLLOW集合中。

这样,仅按上面(1)来设定同步记号集合的话,作为赋值结束的分号的遗漏会引起下一语句的开始关键字被跳过。

8、第74页图3.15第2行改成:C = {closure ({[S'→ · S ]})};9、第80页图3.19倒数第7行改成:置C 的初值为{closure ({[S ' → · S , $]})};10、第111页倒数第4行开始的那段改成: 语法树作为一种中间表示,允许把翻译从分析中分离出来,形成先分析后翻译的方式,即先分析生成语法树,然后再基于语法树进行翻译。

即使是边分析边翻译,语法树作为一种概念上的中间表示,也是有用的。

C 和Java 的编译器通常显式构造语法树。

11、第119页图4.9下第1行第1句改成: 图4.10给出了图4.9的动作是怎样为a *5*b 构造语法树的。

勘误表

勘误表

前言P7第4段:经济学解释的是节约(economizing)和交换的逻辑P8第2段:强调市场过程的动态性和企业家创业(entrepreneurial)性质第四章P68第3段:从他人身上获得什么东西,而这又取决于用这些资源能为他人创造出多大的价值。

P73第1段:图中的柱形表示史密斯种植玉米的边际机会成本,以市场价值衡量。

(给定大豆的价格为每单位1美元)。

P77第3段:从供给曲线顶端征来的人越多,换句话说,从供给曲线底端征来的人越少,强制兵役的成本就越高。

第五章P87:斯密认为,当一个社会的成员有效地掌握了专业化能力,P92倒数第1段:,这说明生产更多的吉他意味着更高的边际机会成本。

P975.7 变化的市场条件第4段:一般认为,电吉他和原声吉他是很好的替代品。

P102倒数第1段:一般来说,你向商业银行借钱跟一个大型企业向银行借钱相比,成本会高一些。

第六章P122:尼德尔纠正他:"22000除以1000是21,不对,是22块钱。

"第七章P139倒数第2段:在市场经济中,工资、租金和利息是获取收入的三种重要形式。

P146:7.10 Entrepreneurship and the Market Process(企业家职能与市场过程)P149第2段:对于评估一项新事业(无论是新开…技术革新)使用稀缺资源的方式是不是比以前更有效率、更有利可图这项任务来讲,市场价格是关键。

倒数第1段:企业家实现的利润或亏损则能进一步提供有关其商业眼光正确与否的信息。

P151:7.14 企业家投机的结果P159第2段:这些问题的答案取决于游戏规则及其创造的产权制度。

第八章P175第1段:我们的选择越少,我们的地位就越不利,我们就越可能被“剥削”。

P179:8.6 竞争作为一个过程倒数第2段:完全竞争会导致假想的资源最优配置以及零利润。

P180第3段:我们已经在第五章中讨论过这一点。

经济活动之间往往有一种内在的关联,对经济系统的拙劣描述常常忽略这一点。

勘误表

勘误表

1. "线性调制"的一种定义是看它是否满足叠加原理(见[1],第 232 页) ,DSB 是线性调制:
m1 (t ) cos ωc t + m2 (t ) cos ωc t = [m1 (t ) + m2 (t )] cos ωc t
46 第 190 页倒 数第 3~5 行 在这个定义下,标准调幅 AM,SSB,2ASK,2PSK 都不是线性调制.但因为它门在实质上是 DSB,所以也可归类于线性调制. 注:对于 AM,用两个基带信号的和做 AM 调制结果虽然也是 AM 信号,但载波分量不是叠加关系 2.还有人将"线性调制"定义为: "调制后信号的频谱为调制信号频谱的平移及线性变换" (见[3],第 27 页) (见 3.因为"线性"一词有"成比例"的意思,故有人也把 FM 叫做线性调制,取 FM 的瞬时频偏同基带调制信号的电压成正比之意. [2],第 138 页)
V P(s1 ) p T s 1
+

=∫

[s1 (τ ) + nw (τ )]s1 (Tb t + τ )dτ
另外请注意其它各处 条件概率的记号
35
第 154 页 (5.3.45)式 第 158 页 (5.4.12)式
V p ( s2 ) p T s 2
P(s1 ) p(VT | s1 ) P(s2 ) p(VT | s2 )
4
33
page 第 147 页倒 数第 2 行
误 滤波器的三分贝单边带宽 B
正 滤波器的等效噪声带宽 B
备注
34 第 152 页 (5.3.27)式
∞ ∞ ∞
= ∫ r (τ )s1 (t Tb + τ )dτ =∫

《算法导论(第二版)》(中文版)课后答案

《算法导论(第二版)》(中文版)课后答案

5
《算法导论(第二版) 》参考答案 do z←y 调用之前保存结果 y←INTERVAL-SEARCH-SUBTREE(y, i) 如果循环是由于y没有左子树,那我们返回y 否则我们返回z,这时意味着没有在z的左子树找到重叠区间 7 if y≠ nil[T] and i overlap int[y] 8 then return y 9 else return z 5 6 15.1-5 由 FASTEST-WAY 算法知:
15
lg n
2 lg n1 1 2cn 2 cn (n 2 ) 2 1
4.3-1 a) n2 b) n2lgn c) n3 4.3-4
2
《算法导论(第二版) 》参考答案 n2lg2n 7.1-2 (1)使用 P146 的 PARTION 函数可以得到 q=r 注意每循环一次 i 加 1,i 的初始值为 p 1 ,循环总共运行 (r 1) p 1次,最 终返回的 i 1 p 1 (r 1) p 1 1 r (2)由题目要求 q=(p+r)/2 可知,PARTITION 函数中的 i,j 变量应该在循环中同 时变化。 Partition(A, p, r) x = A[p]; i = p - 1; j = r + 1; while (TRUE) repeat j--; until A[j] <= x; repeat i++; until A[i] >= x; if (i < j) Swap(A, i, j); else return j; 7.3-2 (1)由 QuickSort 算法最坏情况分析得知:n 个元素每次都划 n-1 和 1 个,因 为是 p<r 的时候才调用,所以为Θ (n) (2)最好情况是每次都在最中间的位置分,所以递推式是: N(n)= 1+ 2*N(n/2) 不难得到:N(n) =Θ (n) 7.4-2 T(n)=2*T(n/2)+ Θ (n) 可以得到 T(n) =Θ (n lgn) 由 P46 Theorem3.1 可得:Ω (n lgn)

勘误表_1_

勘误表_1_

查对轴 O 点外力矩为零.
但对轴 O 点的外力矩为零,
2ω 0 3k
2ω 0 J 3k
第 110 页第 35 行 第 111 页第 14 行 第 111 页第 31 行 第 111 页第 34 行 第 116 页第 14 行 第 118 页第 10 行 第 119 页第 26 行 第 121 页图 7-25 第 122 页第 19 行 第 123 页第 9 行 第 123 页第 19 行 第 124 页习 题 7.3 第 124 页习 题 7.4 第 124 页习 题 7.5 第 125 页习 题 7.6 第 125 页习 题 7.12 第 130 页 1 行 第 139 页最 后1行 第 145 页第 14 行 17 行
从而障碍… 单位矢量位 附件 管壁上的流速
从而阻碍… 单位矢量为 附加 管壁上的流体流速
r(
( p − p 0 )r 2 dv )= e dr 2ηl
r(Байду номын сангаас
dv ( p − p0 ) r 2 )= l dr 2ηl
为血管 答案: 6.6×104Pa (2)…发布, (3)…发布 烧杯盛有的液体置于台秤上,读数 为 18.3N. 答案: 3.6×10-2Pa·s 60m3 与光源的运动状态无关。
=
d2 x d2 y d2 z i+ 2 j+ 2 k dt 2 dt dt
dv v2 e t + en dt ρ
=
d2 x d2 y d2 z i + 2 j + 2 k (x 为标量) dt 2 dt dt
a...= at et + an en =
加速度和与角量 伽里略 向左以 则该质点… 为 dm 的一小团

勘误表

勘误表

《数据结构及算法》勘误表P6 图1-5修改,其正确形式如下(注意单实线和双实线)P13 算法1-1代码正数第2行将“void MatrixMultiply(int A[a], int B[n][n], int C[n][n]) {”改为“void MatrixMultiply(int A[n][n], int B[n][n], int C[n][n]) {”P29 算法2-11,正数第15行将“p=L; j=0;”改为“p=L->next; j=1;”P29 正数第16行将“while((p->next)&&(j<i)) { p=p->next; ++j; }”改为“while(p&&(j<i)) { p=p->next; ++j; }”P29 正数第17行将“if(!(p->next)||(j>=i)) ErrorMessage("输入的i值不合理!");”改为“if(!(p->next)||(j>i)) ErrorMessage("输入的i值不合理!");”P34 正数第7行将“④将p结点赋给新结点的后向指针域;”改为“④将p结点的指针赋给新结点的后向指针域;”P37 倒数第4行将“while((i<=A.length)&&(j<=B.length))”改为“while((i<A.length)&&(j<B.length))”P38 正数第4行将“while(i<=A.length)”改为“while(i<A.length)”P38 正数第7行将“while(j<=B.length)”改为“while(j<B.length)”P38 算法2-20代码开始正数第3行将“while((j<=A.length)&&(j<=B.length))”改为“j=0;while((j<A.length)&&(j<B.length))”P52 算法3-7代码开始正数第3行将“S=new LNode;”改为“S=new S Node;”P53 算法3-10代码开始正数第3行将“if(S->next) EmptyMessage("链栈S空!");”改为“if(!(S->next)) EmptyMessage("链栈S空!");”P54 算法3-12代码开始正数第3行将“if(S->next) EmptyMessage("链栈S空!");”改为“if(!(S->next)) EmptyMessage("链栈S空!");”P61 算法3-22代码开始正数第3行将“if(Q.front->next) EmptyMessage("链队列Q空!");”改为“if(!(Q.front->next)) EmptyMessage("链队列Q空!");”P61 算法3-24代码开始正数第3行将“if(Q.front==Q.rear) EmptyMessage("链队列Q空!");”改为“if(!(Q.front->next)) EmptyMessage("链队列Q空!");”P63 算法3-26代码开始正数第16行将“if(k=1) return 1;”改为“if(k==1) return 1;”P76 正数22行将“(2) 确定两个串的最大相等前缀子串,"s1 s1 … s k "="t1 t1 … t k"(其中1≤k≤m,1≤k≤n)。

《算法导论》习题答案

《算法导论》习题答案
i 1
n/2
n! nn , n! o(nn )
3.2.4 是否多项式有界 lg n !与 lg lg n !
设lgn=m,则 m! 2 m ( )m e2m ( )m em(ln m1) mln m1 nln ln n
∴lgn!不是多项式有界的。
T (n) O(lg n)
4.1.2 证明 T (n) 2T (n) n 的解为 O(n lg n)
设 T (n) c n lg n
T (n) 2c n lg n n c lg n n n c(n 1) lg(n / 2) n cn lg n c lg n cn n cn(lg n 1) n c(lg n 2n)
虽然用二分查找法可以将查找正确位置的时间复杂度降下来,但 是移位操作的复杂度并没有减少, 所以最坏情况下该算法的时间复杂 度依然是 (n2 )
2.3-7 给出一个算法, 使得其能在 (n lg n) 的时间内找出在一个 n 元
素的整数数组内,是否存在两个元素之和为 x
首先利用快速排序将数组排序,时间 (n lg n) ,然后再进行查找:
sin(n / 2) 2 1,所以 af (n / b) cf (n) 不满足。 2(sin n 2)
4.1.6 计算 T (n) 2T (
令 m lg n, T (2 ) 2T (2
m m/ 2
n ) 1 的解
) 1
令 T(n)=S(m),则 S (m) 2S (m / 2) 1 其解为 S (m) (m),T (n) S (m) (lg n)
4.2 The recursion-tree method 4.2.1 4.2.2 4.2.3 4.2.5 略

算法导论(第二版)习题答案(英文版)

算法导论(第二版)习题答案(英文版)

Last update: December 9, 2002
1.2 − 2 Insertion sort beats merge sort when 8n2 < 64n lg n, ⇒ n < 8 lg n, ⇒ 2n/8 < n. This is true for 2 n 43 (found by using a calculator). Rewrite merge sort to use insertion sort for input of size 43 or less in order to improve the running time. 1−1 We assume that all months are 30 days and all years are 365.
n
Θ
i=1
i
= Θ(n2 )
This holds for both the best- and worst-case running time. 2.2 − 3 Given that each element is equally likely to be the one searched for and the element searched for is present in the array, a linear search will on the average have to search through half the elements. This is because half the time the wanted element will be in the first half and half the time it will be in the second half. Both the worst-case and average-case of L INEAR -S EARCH is Θ(n). 3
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
ERRATA 1.2 for Introduction to Algorithms by Cormen, Leiserson, and Rivest July 28, 1994
This list describes the known bugs in the second and subsequent printings of the rst edition of Introduction to Algorithms. An errata sheet for the rst printing is available separately.
a2Var x]ii
Bug fixed
Page 121, line {3
Julie Sussman
The expression be replaced by
(( . hh .
. .
. (1 . (1
; ;
pp))((nn;;kk));;ii)i)i).
has
an
extra
right
parenthesis.
(g(n))ii. After the end of the sentence, insert the sentence hh(An asymptotically positive function is one which is strictly positive for all su ciently large n.)ii. As a result of this change, on page 33, line 9, the words ((asymptotically positive) should no longer be boldfaced.
Lon Sunshine
Page 87, line 14
Charles Leiserson
The term isolated is not de ned. Add the sentence hhA vertex whose degree is 0, such as vertex 4 in Figure 5.2(b), is isolated.i after ((has degree 2.)).
Page 90, Exercise 5.4-2
Bruce Maggs
The exercise should be eliminated, because the bug x to the de nition of a cycle in an undirected graph on page 88, lines 12{13 obviates it.
(1 ; 1=pn)b2n=blg ncc = (eO1;((;e2;n1=l=glgpnn)n;)12)n==plng n;1
= O(1=n) :
For this argument, we used inequality (2.7), 1 + x ex. Thus, the probability that the longest streak exceeds blg nc =2 is at least
A PostScript version of this errata sheet is available via an Internet electronic mail server. To receive instructions on how to use this service, send electronic mail to with algorithms@ \Subject: help" in the message header. The instructions also describe how to submit bug reports by email and how to obtain errata for the rst printing. We regret that we cannot personally respond to all mail.
Julie Sussman
Page 73, Problem 4-4, line 2
Change ((n 2)) to hhn 8ii.
Richard Anderson
3
Page 82, line 11
Change ((equivalent to A.)) to ((equivalent to a.)).
power of 2, the solution of the recurrenceii.
Bug fixed
Page 24, lines 22{24
Charles E. Leiserson
Replace the text ((every member of (g(n)))) with hhevery member f(n) 2
Typically, page and line numbers are given to localize the error. A negative line number indicates numbering from the bottom up. The nder of each bug is credited on the right margin. Actual text from the book is surrounded by (( )). Replacement text, where provided, is surrounded by hh ii.
Move it to
Bug fixed
Page 15, Exercise 1.3-3
Stanley Selkow
Change ((Use mathematical induction to show that the solution of the
recurrence)) to hhUse mathematical induction to show that when n is an exact
Page 35, line 13
Hal Gabow
The
text
((nl!im1
lgb n 2alg n
))
should
be
replaced
by
hhnl!im1
lgb n (2a)lg n
ii.
Page 35, equation (2.12)
Greg Shannon
The upper bound for n! is incorrect for n 7, but is correct, although loose, for n 8. The upper bound should be changed to read as follows: hh n! p2 n(n=e)ne1=12n :
Page xvi, line 28
Change ((Herschel Safer)) to hhHershel Saferii.
Hershel Safer
Page 11, Exercise 1.2-3
Julie Sussman
Exercise 1.2-3 depends on material introduced later in Chapter 1. Section 1.4.
2
Page 27, line {11
Ron Rivest
The text ((on or above g(n).)) should be changed to hhon or above cg(n).ii.
Page 32, line {2
George E. Collins
The condition ((b 6= 0)) should be changed to hhb > 0ii.
Bug fixed
ii
Page 133 (Problem 6-2), line -8 to -6
Julie Sussman
Bug fixed
The problem statement now gives a simpler assumption about the input, which guarantees that the input numbers are distinct: hhAssume that the numbers in A are a random permutation of n distinct numbers.ii In part (a), the element x is also now speci ed to be randomly chosen from a set of hhi ii distinct numbers, instead of a set of ((n)) distinct numbers.
92, line 10
Julie Sussman
The text ((one path)) should be changed to hhone simple pathii.
Page 115, Exercise 6.3-9
Bobby Blumofe
The equation to prove should read hhVar aX] = a2Var X]ii, not hhVar aX] =
Page 67, line 2 of gure caption
Julie Sussman
The text ((height logb a)) should be changed to hhheight logb nii.
Page 71, line {1
The symbol (( )) should be replaced by hh=ii.
Page 33, line {3
Michael Ernst
相关文档
最新文档