Part Ⅰ: PROGRAMMING TECHNIQUES1
第一部分 编程技术
Column 1: Profilers3
第1章 性能监视工具
Computing Primes / 计算素数
Using Profilers / 使用性能监视工具
A Specialized Profiler / 专用的性能监视工具
Building Profilers / 开发性能监视工具
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
Column 2: Associative Arrays15
第2章 关联数组
Associative Arrays in Awk / Awk中的关联数组
A Finite State Machine Simulator / 有穷状态机模拟器
Topological Sorting / 拓扑排序
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
Column 3: Confessions of a Coder27
第3章 程序员的忏悔
Binary Search / 二分搜索
Selection / 选择算法
A Subroutine Library / 子程序库
Principles / 原理
Problems / 习题
Column 4: Self—Describing Data37
第4章 自描述数据
Name—Value Pairs / 名字—值对
Provenances in Programming / 记录来历
A Sorting Lab / 排序实验
Principles / 原理
Problems / 习题
Part Ⅱ: TRICKS OF THE TRADE45
第二部分 实用技巧
Column 5: Cutting the Gordian Knot47
第5章 劈开戈尔迪之结
A Quiz / 小测验
Some Solutions / 解答
Hints / 提示
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
Debugging / 调试(边栏)
Column 6: Bumper—Sticker Computer Science57
第6章 计算机科学箴言集
Coding / 编码
User Interfaces / 用户界面
Debugging / 调试
Performance / 性能
Documentation / 文档
Managing Software / 软件管理
Miscellaneous Rules / 其他
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
Column 7: The Envelope is Back69
第7章 粗略估算
A Warm—Up for Cool Brains / 头脑热身
Performance Rules of Thumb / 性能的经验法则
Little’s Law / Little定律
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
Quick Calculations in Everyday Life / 日常速算(边栏)
Column 8: The Furbelow Memorandum77
第8章 人员备忘录
The Memo / 备忘录
Principles / 原理
Further Reading / 深入阅读
Part Ⅲ: I/O FIT FOR HUMANS81
第三部分 人性化I/O
Column 9: Little Languages83
第9章 小语言
The Pic Language / Pic语言
Perspective / 视角
Pic Preprocessors / Pic预处理器
Little Languages for Implementing Pic / 用来实现Pic的小语言
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
Column 10: Document Design101
第10章 文档设计
Tables / 表格
Three Design Principles / 三条设计原则
Figures / 插图
Text / 文本
The Right Medium / 合适的媒介
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
A Catalog of Pet Peeves / 次要问题目录(边栏)
Column 11: Graphic Output115
第11章 图形化输出
A Case Study / 实例研究
A Sampler of Displays / 显示结果取样
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
Napoleon’s March to Moscow / 拿破仑远征莫斯科(边栏)
Column 12: A Survey of Surveys127
第12章 对调查的研究
The Problems of Polling / 有关民意调查的问题
The Languages / 语言
The Pictures / 图片
Principles / 原理
Problems / 习题
Part Ⅳ: ALGORITHMS137
第四部分 算法
Column 13: A Sample of Brilliance139
第13章 绝妙的取样
A Sampling of Sampling Algorithms / 取样算法一瞥
Floyd’s Algorithm / Floyd算法
Random Permutations / 随机排列
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
Column 14: Birth of a Cruncher147
第14章 / 编写数值计算程序
The Problem / 问题
Newton Iteration / 牛顿迭代
A Great Place to Start / 良好的起点
The Code / 代码
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
A Big Success Story / 数值算法的力量(边栏)
Column 15: Selection159
第15章 选择
The Problem / 问题
The Program / 程序
Analysis of Run Time / 运行时间分析
Principles / 原理
Problems / 习题
Further Reading / 深入阅读
Appendix 1: The C and Awk Languages171
附录A C和Awk语言
Appendix 2: A Subroutine Library175
附录B 子程序库
Solutions to Selected Problems183
部分习题答案
內容試閱:
Most problems have many potential solutions.Consider, for instance, the problem of injuries suffered in automobile accidents.Accidents are avoided by measures such as driver training, strict enforcement of speed limits, stiff penalties for drunk driving, and a good system of public transportation.If accidents do occur, injuries can be reduced by the design of the passenger compartment, wearing seat belts, and air bags.And if injuries are suffered, their effect can be reduced by paramedics at the scene, helicopter ambulances, trauma centers, and corrective surgery.One should understand the costs and benefits of all approaches before spending too much money on any single approach.
Don''t Make the Problem Too Hard.An old puzzle asks how a barometer can be used to compute the height of a building.Answers range from dropping the instrument from the top and measuring the time of its fall to giving it to the building''s superintendent in return for a look at the plans.A modern version of the puzzle asks how a personal computer can balance a checkbook.An elegant solution is to sell the machine and deposit the money.