Algorithms in a Nutshell is a book aimed at programmers who need practical examples of how to use them to solve problems in their software. As the authors say right in the beginning, they didn't want to write a book that was either too abstract or too focused on solving a particular problem. As they put it, the problem with the former is that, except for the simplest examples, the pseudo-code doesn't provide enough help turning that into actual working code; while the later is often too closely tied to the problem being demonstrated so the coder has to figure out how to separate the general algorithm from the specific example. Instead the approach they took is to teach the reader to figure out what they need, what algorithms are available to solve problems, and what to do when there isn't an apparent solution available.

Finding what you need in the first place is a critical step, and it's addressed in several places in the book; chapter 11 mentions the principal "know your data", that pretty much sums up the idea that you have to know what you want to accomplish before picking a specific algorithm. As an example, the sorting chapter shows a number of different algorithms and points out cases where the simpler to write ones (i.e. potentially less bugs to hunt down) might be fine for a situation as long as the data set isn't too large. Once you know how to define what you are looking for, the next step is finding the tool to solve it.

The middle section covers about 35 different algorithms in the areas of sorting, searching, graph algorithms, path-finding, network flow algorithms and computational geometry. Each algorithm is explained along with some variations and optimizations that are commonly done. One interesting feature of the book is the fact-sheets that provide a graphical overview of the algorithm being discussed including some pseudo-code, O-notation and some performance and implementation notes, e.g. brute-force (these icons are explained on pages 41-43) that give a quick overview of the algorithm being discussed.

Finally the book discusses what to do when there isn't an apparent solution. The advice given is to do two things: figure out what you are trying to solve ("know your data") and break your problem down into smaller, solvable problems.

It took me a bit of time to find the source code mentioned in the book, eventually found it in the "Releases" folder along with code from an O'Reilly blog on algorithms by the same authors - which also explained the meaning of the name (ADK: Algorithms Development Kit) used for the source code. The code is provided in various languages, mostly C/C++ and Java, with some Ruby in places, mostly as a comparison. The layout reminds me a bit of the "Hacks" series of books, it's small format, about 350 pages black/white/gray layout. I'd recommend this book as a good reference.

[asa]059651624X[/asa]