算法技术手册(英文影印版)
基本信息
- 原书名: Algorithms in a Nutshell
- 原出版社: O'Reilly Media, Inc.
- 作者: George T. Heineman Gary Pollice Stanley Selkow [作译者介绍]
- 丛书名: 东南大学出版社O'Reilly系列
- 出版社:东南大学出版社
- ISBN:9787564116323
- 上架时间:2009-5-31
- 出版日期:2009 年4月
- 开本:16开
- 页码:343
- 版次:1-1
- 所属分类:
计算机 > 计算机科学理论与基础知识 > 计算理论 > 算法
编辑推荐
相对于理论来说,本书更注重实际运用,书中提供了多种程序语言中可用的有效代码解决方案,可轻而易举地适合一个特定的项目。
内容简介回到顶部↑
创造稳定的软件需要有效的算法,但是程序设计者们很少能在问题出现之前就想到。《算法技术手册》描述了现有的可以解决多种问题的算法,并且能够帮助你根据需求选择并实现正确的算法——只需要一定的数学知识即可理解并分析算法执行。.
相对于理论来说,本书更注重实际运用,书中提供了多种程序语言中可用的有效代码解决方案,可轻而易举地适合一个特定的项目。有了这本书,你可以:
* 解决特定编码问题或改进现有解决方案的执行
* 迅速确定与需要解决的问题相关的算法,并判定为什么这样的算法是正确的
* 探索c、c++、java、ruby中的算法解决方案,伴有实现诀窍..
* 了解一个算法预期的执行情况及最佳的执行条件
* 发现不同算法中相似设计产生的冲突
* 学习先进的数据结构以改进算法效率
有了《算法技术手册》,你可以学习如何改进算法的性能,这是软件应用成功的关键。...
相对于理论来说,本书更注重实际运用,书中提供了多种程序语言中可用的有效代码解决方案,可轻而易举地适合一个特定的项目。有了这本书,你可以:
* 解决特定编码问题或改进现有解决方案的执行
* 迅速确定与需要解决的问题相关的算法,并判定为什么这样的算法是正确的
* 探索c、c++、java、ruby中的算法解决方案,伴有实现诀窍..
* 了解一个算法预期的执行情况及最佳的执行条件
* 发现不同算法中相似设计产生的冲突
* 学习先进的数据结构以改进算法效率
有了《算法技术手册》,你可以学习如何改进算法的性能,这是软件应用成功的关键。...
作译者回到顶部↑
本书提供作译者介绍
George T.Heineman,Gary Pollice和Stanley Selkow 均为Worcester Polytechnic Institute(伍斯特理工学院)计算机科学系的教授。George是《Component-Based Software Engineering:Putting the Pieces Together》(Addison-Wesley)的合编者,Gary则是《Head First Object-Oriented Analysis and Design》的合著者。...
.. << 查看详细
.. << 查看详细
目录回到顶部↑
preface .
part i.
1. algorithms matter
understand the problem
experiment if necessary
algorithms to the rescue
side story
the moral of the story
references
2. the mathematics of algorithms
size of a problem instance
rate of growth of functions
analysis in the best, average, and worst cases
performance families
mix of operations
benchmark operations
one final point
references
3. patterns and domains
patterns: a communication language
part i.
1. algorithms matter
understand the problem
experiment if necessary
algorithms to the rescue
side story
the moral of the story
references
2. the mathematics of algorithms
size of a problem instance
rate of growth of functions
analysis in the best, average, and worst cases
performance families
mix of operations
benchmark operations
one final point
references
3. patterns and domains
patterns: a communication language
前言回到顶部↑
As Trinity states in the movie The Matrix:
It's the question that drives us, Neo. It's the question that brought you here. .
You know the question, just as I did.
As authors of this hook, we answer the question that has led you here:
Can I use algorithm X to solve my problem? If so, how do I implement it?
You likely do not need to understand the reasons why an algorithm is correct--if you do, turn to other sources, such as the 1,180-page bible on algorithms, Introduction to Algorithms, Second Edition, by Thomas H. Cormen et al. (2001). There you will find lemmas, theorems, and proofs; you will find exercises and step-by-step examples showing the algorithms as they perform. Perhaps surprisingly, however, you will not find any real code, only fragments of "pseudocode," the device used by countless educational textbooks to present a high-level description of algorithms. These educational textbooks are important within the classroom, yet they fail the software practitioner because they assume it will be straightforward to develop real code from pseudocode fragments.
We intend this book to be used frequently by experienced programmers looking for appropriate solutions to their problems. Here you will find solutions to the problems you must overcome as a programmer every day. You will learn what decisions lead to an improved performance of key algorithms that are essential for the success of your software applications. You will find real code that can be adapted to your needs and solution methods that you can learn.
All algorithms are fully implemented with test suites that validate the correct implementation of the algorithms. The code is fully documented and available as a code repository addendum to this book. We rigorously followed a set of principles as we designed, implemented, and wrote this book. If these principles are meaningful to you, then you will find this book useful.
Principle: Use Real Code, Not Pseudocode
What is a practitioner to do with Figure P-l's description of the FORD-FULKERSON algorithm for computing maximum network flow?
The algorithm description in this figure comes from Wikipedia (http://en. wikipedia.org/wiki/Ford_Fulkerson), and it is nearly identical to the pseudocode found in (Cormen et al., 2001). It is simply unreasonable to expect a software practitioner to produce working code from the description of FORD-FULKERSON shown here! Turn to Chapter 8 to see our code listing by comparison. We use only documented, well-designed code to describe the algorithms. Use the code we provide as-is, or include its logic in your own programming language and software system.
Some algorithm textbooks do have full real-code solutions in C or Java. Often the purpose of these textbooks is to either teach the language to a beginner or to explain how to implement abstract data types. Additionally, to include code listings within the narrow confines of a textbook page, authors routinely omit documentation and error handling, or use shortcuts never used in practice. We believe programmers can learn much from documented, well-designed code, which is why we dedicated so much effort to develop actual solutions for our algorithms.
Principle: Separate the Algorithm from the Problem Being Solved It is hard to show the implementation for an algorithm "in the general sense" without also involving details of the specific solution. We are critical of books that show a full implementation of an algorithm yet allow the details of the specific problem to become so intertwined with the code for the generic problem that it is hard to identify the structure of the original algorithm. Even worse, many available implementations rely on sets of arrays for storing information in a way that is "simpler" to code but harder to understand. Too often, the reader will understand the concept from the supplementary text but be unable to implement it!
In our approach, we design each implementation to separate the generic algorithm from the specific problem. In Chapter 7, for example, when we describe the A'SEARCH algorithm, we use an example such as the 8-puzzle (a sliding tile puzzle with tiles numbered 1-8 in a three-by-three grid). The implementation of A'SEARCH depends only on a set of well-defined interfaces, The details of the specific 8-puzzle problem are encapsulated cleanly within classes that implement these interfaces.
We use numerous programming languages in this book and follow a strict design methodology to ensure that the code is readable and the solutions are efficient. Because of our software engineering background, it was second nature to design clear interfaces between the general algorithms and the domain-specific solutions. Coding in this way produces software that is easy to test, maintain, and expand to solve the problems at hand. One added benefit is that the modern audience can more easily read and understand the resulting descriptions of the algorithms. For select algorithms, we show how to convert the readable and efficient code that we produced into highly optimized (though less readable) code with improved performance. After all, the only time that optimization should be done is when the problem has been solved and the client demands faster code. Even then it is worth listening to C. A. R. Hoare, who stated, "Premature optimization is the root of all evil."
Principle: Introduce Just Enough Mathematics
Many treatments of algorithms focus nearly exclusively on proving the correctness of the algorithm and explaining only at a high level its details. Our focus is always on showing how the algorithm is to be implemented in practice. To this end, we only introduce the mathematics needed to understand the data structures and the control flow of the solutions.
For example, one needs to understand the properties of sets and binary trees for many algorithms. At the same time, however, there is no need to include a proof by induction on the height of a binary tree to explain how a red-black binary tree is balanced; read Chapter 13 in (Cormen et al., 2001) if you want those details. We explain the results as needed, and refer the reader to other sources to understand how to prove these results mathematically.
In this book you will learn the key terms and analytic techniques to differentiate algorithm behavior based on the data structures used and the desired functionality.
Principle: Support Mathematical Analysis Empirically
It's the question that drives us, Neo. It's the question that brought you here. .
You know the question, just as I did.
As authors of this hook, we answer the question that has led you here:
Can I use algorithm X to solve my problem? If so, how do I implement it?
You likely do not need to understand the reasons why an algorithm is correct--if you do, turn to other sources, such as the 1,180-page bible on algorithms, Introduction to Algorithms, Second Edition, by Thomas H. Cormen et al. (2001). There you will find lemmas, theorems, and proofs; you will find exercises and step-by-step examples showing the algorithms as they perform. Perhaps surprisingly, however, you will not find any real code, only fragments of "pseudocode," the device used by countless educational textbooks to present a high-level description of algorithms. These educational textbooks are important within the classroom, yet they fail the software practitioner because they assume it will be straightforward to develop real code from pseudocode fragments.
We intend this book to be used frequently by experienced programmers looking for appropriate solutions to their problems. Here you will find solutions to the problems you must overcome as a programmer every day. You will learn what decisions lead to an improved performance of key algorithms that are essential for the success of your software applications. You will find real code that can be adapted to your needs and solution methods that you can learn.
All algorithms are fully implemented with test suites that validate the correct implementation of the algorithms. The code is fully documented and available as a code repository addendum to this book. We rigorously followed a set of principles as we designed, implemented, and wrote this book. If these principles are meaningful to you, then you will find this book useful.
Principle: Use Real Code, Not Pseudocode
What is a practitioner to do with Figure P-l's description of the FORD-FULKERSON algorithm for computing maximum network flow?
The algorithm description in this figure comes from Wikipedia (http://en. wikipedia.org/wiki/Ford_Fulkerson), and it is nearly identical to the pseudocode found in (Cormen et al., 2001). It is simply unreasonable to expect a software practitioner to produce working code from the description of FORD-FULKERSON shown here! Turn to Chapter 8 to see our code listing by comparison. We use only documented, well-designed code to describe the algorithms. Use the code we provide as-is, or include its logic in your own programming language and software system.
Some algorithm textbooks do have full real-code solutions in C or Java. Often the purpose of these textbooks is to either teach the language to a beginner or to explain how to implement abstract data types. Additionally, to include code listings within the narrow confines of a textbook page, authors routinely omit documentation and error handling, or use shortcuts never used in practice. We believe programmers can learn much from documented, well-designed code, which is why we dedicated so much effort to develop actual solutions for our algorithms.
Principle: Separate the Algorithm from the Problem Being Solved It is hard to show the implementation for an algorithm "in the general sense" without also involving details of the specific solution. We are critical of books that show a full implementation of an algorithm yet allow the details of the specific problem to become so intertwined with the code for the generic problem that it is hard to identify the structure of the original algorithm. Even worse, many available implementations rely on sets of arrays for storing information in a way that is "simpler" to code but harder to understand. Too often, the reader will understand the concept from the supplementary text but be unable to implement it!
In our approach, we design each implementation to separate the generic algorithm from the specific problem. In Chapter 7, for example, when we describe the A'SEARCH algorithm, we use an example such as the 8-puzzle (a sliding tile puzzle with tiles numbered 1-8 in a three-by-three grid). The implementation of A'SEARCH depends only on a set of well-defined interfaces, The details of the specific 8-puzzle problem are encapsulated cleanly within classes that implement these interfaces.
We use numerous programming languages in this book and follow a strict design methodology to ensure that the code is readable and the solutions are efficient. Because of our software engineering background, it was second nature to design clear interfaces between the general algorithms and the domain-specific solutions. Coding in this way produces software that is easy to test, maintain, and expand to solve the problems at hand. One added benefit is that the modern audience can more easily read and understand the resulting descriptions of the algorithms. For select algorithms, we show how to convert the readable and efficient code that we produced into highly optimized (though less readable) code with improved performance. After all, the only time that optimization should be done is when the problem has been solved and the client demands faster code. Even then it is worth listening to C. A. R. Hoare, who stated, "Premature optimization is the root of all evil."
Principle: Introduce Just Enough Mathematics
Many treatments of algorithms focus nearly exclusively on proving the correctness of the algorithm and explaining only at a high level its details. Our focus is always on showing how the algorithm is to be implemented in practice. To this end, we only introduce the mathematics needed to understand the data structures and the control flow of the solutions.
For example, one needs to understand the properties of sets and binary trees for many algorithms. At the same time, however, there is no need to include a proof by induction on the height of a binary tree to explain how a red-black binary tree is balanced; read Chapter 13 in (Cormen et al., 2001) if you want those details. We explain the results as needed, and refer the reader to other sources to understand how to prove these results mathematically.
In this book you will learn the key terms and analytic techniques to differentiate algorithm behavior based on the data structures used and the desired functionality.
Principle: Support Mathematical Analysis Empirically
媒体评论回到顶部↑
“作者汲取了大量鲜为人知的文献资料,这本不可或缺的指南巩固了理论与实际操作的完美平衡。通过它来理解算法变得更加轻松容易。”
——Matthew Russell,高级技术总监,Digital Reasoning System;《Dojo:The Definitive Guide》的作者(O'Reilly)...
——Matthew Russell,高级技术总监,Digital Reasoning System;《Dojo:The Definitive Guide》的作者(O'Reilly)...

点击看大图




加载中...
