没有合适的资源?快使用搜索试试~ 我知道了~
首页计算机算法:设计与分析导论 影印版答案
计算机算法:设计与分析导论 影印版答案
5星 · 超过95%的资源 需积分: 31 189 下载量 88 浏览量
更新于2023-03-03
评论 4
收藏 864KB PDF 举报
Computer Algorithms:Introduction to Design and Analysis. Sara Baase,高等教育出版社,影印版。英文版课后习题答案。
资源详情
资源评论
资源推荐
Computer Algorithms, Third Edition,
Solutions to Selected Exercises
Sara Baase
Allen Van Gelder
February 25, 2000
ii
INTRODUCTION
This manual contains solutions for the selected exercises in Computer Algorithms: Introduction to Design and Analy-
sis, third edition, by Sara Baase and Allen Van Gelder.
Solutions manuals are intended primarily for instructors, but it is a fact that instructors sometimes put copies in
campus libraries or on their web pages for use by students. For instructors who prefer to have students work on
problems without access to solutions, we have chosen not to include all the exercises from the text in this manual. The
included exercises are listed in the table of contents. Roughly every other exercise is solved.
Some of the solutions were written specifically for this manual; others are adapted from solutions sets handed out
to students in classes we taught (written by ourselves, teaching assistants, and students).
Thus there is some inconsistency in the style and amount of detail in the solutions. Some may seem to be addressed
to instructors and some to students. We decided not to change these inconsistencies, in part because the manual will be
read by instructors and students. In some cases there is more detail, explanation, or justification than a student might
be expected to supply on a homework assignment.
Many of the solutions use the same pseudocode conventions used in the text, such as:
1. Block delimiters (“
f
”and“
g
”) are omitted. Block boundaries are indicated by indentation.
2. The keyword static is omitted from method (function and procedure) declarations. All methods declared in
the solutions are static.
3. Class name qualifiers are omitted from method (function and procedure) calls. For example, x = cons(z,
x) might be written when the Java syntax requires x = IntList.cons(z, x).
4. Keywords to control visibility, public, private,andprotected, are omitted.
5. Mathematical relational operators “
6
=
,” “
,” and “
” are usually written, instead of their keyboard versions.
Relational operators are used on types where the meaning is clear, such as String, even though this would be
invalid syntax in Java.
We thank Chuck Sanders for writing most of the solutions for Chapter 2 and for contributing many solutions in
Chapter 14. We thank Luo Hong, a graduate student at UC Santa Cruz, for assisting with several solutions in Chapters
9, 10, 11, and 13.
In a few cases the solutions given in this manual are affected by corrections and clarifications to the text. These
cases are indicated at the beginning of each affected solution. The up-to-date information on corrections and clarifica-
tions, along with other supplementary materials for students, can be found at these Internet sites:
ftp://ftp.aw.com/cseng/authors/baase
http://www-rohan.sdsu.edu/faculty/baase
http://www.cse.ucsc.edu/personnel/faculty/avg.html
c
Copyright 2000 Sara Baase and Allen Van Gelder. All rights reserved.
Permission is granted for college and university instructors to make a reasonable number of copies, free of charge,
as needed to plan and administer their courses. Instructors are expected to exercise reasonable precautions against
further, unauthorized copies, whether on paper, electronic, or other media.
Permission is also granted for Addison-Wesley-Longman editorial, marketing, and sales staff to provide copies
free of charge to instructors and prospective instructors, and to make copies for their own use.
Other copies, whether paper, electronic, or other media, are prohibited without prior written consent of the authors.
List of Solved Exercises
1 Analyzing Algorithms and Problems: Principles and Examples 1
1.1....... 1
1.2....... 2
1.4....... 2
1.6....... 2
1.8....... 3
1.10 ...... 3
1.12 ...... 3
1.13 ...... 3
1.15 ...... 4
1.18 ...... 4
1.20 ...... 4
1.22 ...... 4
1.23 ...... 4
1.25 ...... 5
1.28 ...... 5
1.31 ...... 6
1.33 ...... 6
1.35 ...... 6
1.37 ...... 6
1.39 ...... 6
1.42 ...... 7
1.44 ...... 7
1.46 ...... 7
1.47 ...... 7
1.48 ...... 7
1.50 ...... 8
2 Data Abstraction and Basic Data Structures 9
2.2....... 9
2.4....... 9
2.6....... 9
2.8....... 9
2.10 ...... 11
2.12 ...... 11
2.14 ...... 12
2.16 ...... 13
2.18 ...... 14
3 Recursion and Induction 17
3.2....... 17
3.4....... 17
3.6....... 17
3.8....... 18
3.10 ...... 18
3.12 ...... 18
4Sorting 19
4.2....... 19
4.4....... 19
4.6....... 19
4.9....... 19
4.11 ...... 19
4.13 ...... 20
4.15 ...... 20
4.17 ...... 20
4.19 ...... 21
4.21 ...... 21
4.23 ...... 21
4.25 ...... 22
4.26 ...... 22
4.27 ...... 23
4.29 ...... 23
4.31 ...... 23
4.34 ...... 24
4.35 ...... 24
4.37 ...... 24
4.40 ...... 24
4.42 ...... 24
4.44 ...... 25
4.45 ...... 25
4.46 ...... 25
4.48 ...... 25
4.49 ...... 25
4.51 ...... 26
4.53 ...... 26
4.55 ...... 27
4.57 ...... 27
4.59 ...... 28
4.61 ...... 28
4.63 ...... 29
4.65 ...... 29
5 Selection and Adversary Arguments 31
5.2....... 31
5.4....... 32
5.6....... 32
5.8....... 33
5.10 ...... 34
5.12 ...... 34
5.14 ...... 34
5.16 ...... 34
5.19 ...... 35
5.21 ...... 35
5.22 ...... 36
5.24 ...... 37
6 Dynamic Sets and Searching 39
6.1....... 39
6.2....... 39
6.4....... 40
6.6....... 40
6.8....... 41
6.10 ...... 41
6.12 ...... 41
6.14 ...... 43
6.16 ...... 45
6.18 ...... 45
6.20 ...... 45
6.22 ...... 46
6.24 ...... 47
6.26 ...... 47
6.28 ...... 47
6.30 ...... 47
6.32 ...... 48
6.34 ...... 49
6.36 ...... 49
6.37 ...... 49
6.40 ...... 50
iv List of Solved Exercises
7 Graphs and Graph Traversals 51
7.1....... 51
7.3....... 51
7.4....... 51
7.6....... 51
7.8....... 51
7.10 ...... 52
7.12 ...... 52
7.14 ...... 53
7.16 ...... 53
7.18 ...... 53
7.20 ...... 54
7.22 ...... 54
7.24 ...... 54
7.27 ...... 57
7.28 ...... 57
7.30 ...... 57
7.32 ...... 57
7.34 ...... 57
7.35 ...... 58
7.37 ...... 59
7.39 ...... 59
7.40 ...... 59
7.41 ...... 59
7.43 ...... 59
7.45 ...... 60
7.47 ...... 60
7.49 ...... 61
8 Graph Optimization Problems and Greedy Algorithms 63
8.1....... 63
8.3....... 63
8.5....... 63
8.7....... 64
8.8....... 64
8.10 ...... 64
8.12 ...... 64
8.14 ...... 64
8.16 ...... 65
8.18 ...... 65
8.20 ...... 65
8.22 ...... 67
8.24 ...... 67
8.26 ...... 67
8.27 ...... 67
9 Transitive Closure, All-Pairs Shortest Paths 69
9.2....... 69
9.4....... 70
9.6....... 71
9.7....... 71
9.8....... 71
9.10 ...... 71
9.12 ...... 72
9.14 ...... 72
9.16 ...... 72
9.18 ...... 72
10 Dynamic Programming 73
10.2 ...... 73
10.4 ...... 73
10.5 ...... 73
10.7 ...... 73
10.9 ...... 73
10.10 . . . . . 74
10.12 . . . . . 75
10.14 . . . . . 75
10.16 ..... 75
10.18 ..... 76
10.19 ..... 77
10.21 ..... 78
10.23 . . . . . 78
10.26 . . . . . 79
11 String Matching 81
11.1 ...... 81
11.2 ...... 81
11.4 ...... 81
11.6 ...... 83
11.8 ...... 84
11.10 . . . . . 84
11.12 . . . . . 84
11.15 . . . . . 84
11.17 ..... 84
11.19 ..... 85
11.21 ..... 85
11.23 ..... 85
11.25 . . . . . 86
12 Polynomials and Matrices 87
12.2 ...... 87
12.4 ...... 87
12.6 ...... 87
12.8 ...... 87
12.10 . . . . . 87
12.12 . . . . . 88
12.14 ..... 88
12.16 ..... 88
12.17 ..... 88
13
NP-Complete Problems 89
13.2 ...... 89
13.4 ...... 89
13.6 ...... 91
13.8 ...... 91
13.10 ..... 91
13.12 ..... 91
13.14 . . . . . 92
13.16 . . . . . 92
13.18 . . . . . 92
13.20 . . . . . 93
13.21 . . . . . 93
13.23 . . . . . 93
13.26 ..... 93
13.28 ..... 93
13.30 ..... 94
13.32 ..... 94
13.34 ..... 96
13.35 ..... 96
13.37 . . . . . 96
13.39 . . . . . 96
13.42 . . . . . 98
13.44 . . . . . 99
13.47 . . . . . 99
13.49 . . . . . 99
List of Solved Exercises v
13.51 ..... 99
13.53 ..... 100
13.54 . . . . . 100
13.55 . . . . . 100
13.57 ..... 100
13.59 ..... 101
13.61 . . . . . 101
14 Parallel Algorithms 103
14.2 ...... 103
14.4 ...... 103
14.5 ...... 103
14.7 ...... 104
14.8 ...... 104
14.10 . . . . . 104
14.11 . . . . . 104
14.13 . . . . . 104
14.14 . . . . . 105
14.16 . . . . . 105
14.18 ..... 105
14.19 ..... 106
14.20 ..... 106
14.22 ..... 106
14.24 ..... 106
14.25 . . . . . 106
14.27 . . . . . 107
14.29 . . . . . 107
14.30 . . . . . 108
14.32 . . . . . 108
剩余113页未读,继续阅读
cxfeng
- 粉丝: 2
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 2023年中国辣条食品行业创新及消费需求洞察报告.pptx
- 2023年半导体行业20强品牌.pptx
- 2023年全球电力行业评论.pptx
- 2023年全球网络安全现状-劳动力资源和网络运营的全球发展新态势.pptx
- 毕业设计-基于单片机的液体密度检测系统设计.doc
- 家用清扫机器人设计.doc
- 基于VB+数据库SQL的教师信息管理系统设计与实现 计算机专业设计范文模板参考资料.pdf
- 官塘驿林场林防火(资源监管)“空天地人”四位一体监测系统方案.doc
- 基于专利语义表征的技术预见方法及其应用.docx
- 浅谈电子商务的现状及发展趋势学习总结.doc
- 基于单片机的智能仓库温湿度控制系统 (2).pdf
- 基于SSM框架知识产权管理系统 (2).pdf
- 9年终工作总结新年计划PPT模板.pptx
- Hytera海能达CH04L01 说明书.pdf
- 数据中心运维操作标准及流程.pdf
- 报告模板 -成本分析与报告培训之三.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论8