读书笔记-《Algorithms in Java》-序言-07/10/11

2007年10月11日 21:00:01
2007年10月12日 8:35:34 翻译

Form：《Algorithms in Java: Parts 1-4, Third Edition》

1、Most algorithms of interest involve methods of organizing the data involved in the computation. Objects created in this way are called data structures, and they also are central objects of study in computer science. Thus, algorithms and data structures go hand in hand.

（特定的数据结构有特定的算法，比如：估算降雨量要用毫米数，不能用雨滴的个数。在这种问题上，越是精确，越是没意义。模糊数学里的东西。）

2、Careful algorithm design is an extremely effective part of the process of solving a huge problem, whatever the applications area.

（好像听人说过，一种科学，如果没用上数学，那就称不上是严谨的科学。大概这个意思吧。）

3、When a huge or complex computer program is to be developed, a great deal of effort must go into understanding and defining the problem to be solved, managing its complexity, and decomposing it into smaller subtasks that can be implemented easily.

（分而治之是最基本的思想）

4、The Java libraries contain implementations of a host of fundamental algorithms. However, implementing simple versions of basic algorithms helps us to understand them better and thus to more effectively use and tune advanced versions from a library. More important, the opportunity to reimplement basic algorithms arises frequently. The primary reason to do so is that we are faced, all too often, with completely new computing environments (hardware and software) with new features that old implementations may not use to best advantage. In other words, we often implement basic algorithms tailored to our problem, rather than depending on a system routine, to make our solutions more portable and longer lasting. Another common reason to reimplement basic algorithms is that, despite the advances embodied in Java, the mechanisms that we use for sharing software are not always sufficiently powerful to allow us to conveniently tailor library programs to perform effectively on specific tasks.
java库包含了大量的基础算法的实现。然而，实现简单版本的基本算法帮助我们更好地理解它们，这样就能更高效地运用它们，并且从库中使用更高级的版本。更重要的是，重新实现基本算法的机会变得很频繁。这样做的主要原因是我们会遇到，并且经常遇到全新的计算机环境（软件和硬件），这样旧有的实现就可能不是最佳的了。换句话说，我们经常根据我们的问题实现基本算法，而不是例行公事地，让我们的解决方案更便捷、持续得更长久。另一个很普遍的原因是重新实现基本的算法，不管java包含的算法如何优秀，我们在设计软件时采用它实现的机制，并不能总是满足我们特定任务的需要。
（也就是说在特定的情况下，需要我们根据问题来实现基本的算法，而不是java的库，库只是通用的，有时并不能满足特定的需要。不要以为学习基本算法是在重新发明轮子。有个叫刘喆的同学也说过类似的话^_^）

5、Computer programs are often overoptimized. It may not be worthwhile to take pains to ensure that an implementation of a particular algorithm is the most efficient possible unless the algorithm is to be used for an enormous task or is to be used many times.

（在Joshua Bloch著的《Effective Java》中有过相同的论述，很有意思。他提出两条：第一条，如果你不是专家的话，请不要做优化。第二条，如果你是专家的话，很好，请参看第一条。

6、 We do pay careful attention to carefully coding the critical parts of the algorithms, and take pains to note where low-level optimization effort could be most beneficial.

（也就是算法中最核心的部分，有点80/20原则的意味。）

7、The choice of the best algorithm for a particular task can be a complicated process, perhaps involving sophisticated mathematical analysis. The branch of computer science that comprises the study of such questions is called analysis of algorithms.

（看来学计算机要学的深入，不学数学是不行的，我得恶补一下了。）

8、We should not use an algorithm without having an idea of what resources it might consume, and we strive to be aware of how our algorithms might be expected to perform.

（生了孩子就要对他/她负责，否则就不要生他/她。）
• 本文已收录于以下专栏：

举报原因： 您举报文章：读书笔记-《Algorithms in Java》-序言-07/10/11 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)