UKUUG home


(the UK's Unix & Open Systems User Group)






Book Discounts

Other Discounts

Mailing lists






Algorithms in a Nutshell (In a Nutshell (O'Reilly))

George Heineman, Gary Pollice and Stanley Selkow
Published by O'Reilly Media
ISBN: 978-0-596-51624-6
362 pages
£ 38.50
Published: 21st October 2008
reviewed by James Youngman
   in the June 2009 issue (pdf), (html)

The authors state “We intend this book to be used frequently by experienced programmers looking for appropriate solutions to their problems”. This focus allows them to cover a wide field in a fairly short book.

“Algorithms in a Nutshell” is the first newly-printed O'Reilly book I've come across in a while, and the first thing I noticed about it is that the paper seems less smooth than older O'Reilly books. Perhaps it's recycled paper or something, but I found it feels less pleasant in my hands than older O'Reilly books.

This is an interesting time to be reading algorithms books; several fascicles of the long-awaited volume 4 of Knuth's The Art Of Computer Programming have recently been published. Also but less famously though, the second edition of Steven Skiena's “The Algorithm Design Manual” was published in 2008. More of this later.

Many algorithms books are largely formal in nature, dealing with the analysis of the correctness and asymptotic efficiency of algorithms. Most of the time I spend reading algorithms books I'm actually looking for an algorithm applicable to my problem in order to implement it. Quite often the style of pseudo-code presentation in such books isn't very suitable for easy implementation. The book singles out Cormen's widely recommended and authoritative “Introduction to Algorithms” book as an example of such books. They certainly have a point.

In terms of presentation, the “Algorithms in a Nutshell” book has much more in common with “The Algorithm Design Manual” or perhaps Robert Sedgwick's “Algorithms in …” books, though it's certainly shorter than either.

The Nutshell book includes Java, C or C++ implementations of each algorithm. It's divided into three parts; part 1 contains introductory material, part 2 presents the algorithms and parts 3 and 4 discuss non-optimal algorithms and benchmarking. Part 2 breaks down into:

The ground covered is roughly the same as Sedgwick's work, though there is much less emphasis on data structures. I think this is a reasonable decision for books intended for working programmers; most professional programmers will have available standard libraries providing implementations of advanced data structures (indeed, if they are not already built into the language they're using). Omitting material on data structures would have been a bad idea for an introductory text, but that's not what this book intends to be.

Like most programmers I need to be careful about the origins and license of any code that I re-use. The O'Reilly book attempts to set out clearly that you can re-use their code in your programs (though they fail to define the boundaries of this any more closely than “unless you're reproducing a significant portion of the code”). That seems much more helpful than Skiena's blanket inhibition “Permission is granted for use in non-commercial applications provided this copyright notice remains intact and unchanged.” That would certainly make it impossible for me to incorporate his code in a GPLed program, for example. That would make Skiena's book quite irritating to use if it weren't for the fact that he indicates for each algorithm which online code collections provide good implementations.

Although I have a copy of each of the books I've mentioned in this review, I don't use them all equally. I probably make least use of Cormen (it sits on my work bookshelf looking imposingly authoritative but almost never gets consulted) and so far, probably most use of Skiena's “The Algorithm Design Manual”. My guess is that I'd probably refer to both the Skiena book and the Nutshell book when looking for an algorithm (and, in all likelihood, search the web once I figured out a shortlist of appropriate algorithms). It's a little early to say for sure whether I think it's worthwhile to own both books, but if I had to choose between them I'd probably choose Skiena.

Back to reviews list

Tel: 01763 273 475
Fax: 01763 273 255
Web: Webmaster
Queries: Ask Here
Join UKUUG Today!

UKUUG Secretariat
More information

Page last modified 29 May 2009
Copyright © 1995-2011 UKUUG Ltd.