Fog Creek Software
Discussion Board

Algorithm Reference

Does anybody know a great reference book on algorithms for software developers?

It would describe how to (for example):

Do a binary search (trees)
Sort an n-dimensional array (different sort techniques)
Describe some Financial Functions from 1st principles
Reversing Strings
Managing Queues and Stacks
plus lots more

All in one huge reference book, or library.

Mike Wainright
Wednesday, December 4, 2002

The classic is, of course, Knuth's "The Art of Computer Programming".  However, they're about as dense as they could be, and all the code is in assembler for an imaginary CPU.  Volumes 1-3 are out, and Volume 4 is on the way and available in pieces ("fascicles") on the web.  There are supposed to be 5 books in the series.  Then Knuth will slump over, and computer no more.

If you want something more accessible, and using a language you're familiar with, O'Reilly has several good books: Mastering Algorithms with C, Mastering Algorithms with Perl.  Also, there are good textbooks out there.  I'm currently in "Data Structures and Algorithm Analysis in C++", by Weiss; I'm pretty happy with it.  The same book exists with Java examples, I believe.

Justin Johnson
Wednesday, December 4, 2002

My favorite is "Introduction to Algorithms":

Donald Knuth has an excellent set of books on algorithms:

Another good reference is the set by Robert Sedgewick:

Wednesday, December 4, 2002

There's also the Collected Algorithms of the ACM:

not me
Wednesday, December 4, 2002

I'll second the recommendation Weiss's books.

Wednesday, December 4, 2002

Knuth is well worth reading if you're interested in learning how to design and analyze algorithms. If you're looking more for an algorithm cookbook, I'd suggest going elsewhere. I've had good luck with Sedgewick, but you have to be careful - his code has lots of typos.

For day to day coding, the cookbook is MUCH more useful.

Chris Tavares
Wednesday, December 4, 2002

i second (third?) the sedgewick set.

Wednesday, December 4, 2002

Also, review the built-in or open-source libraries that are available for your programming language, so you don't end up re-inventing the wheel. The Java collection classes include all of the standard algorithms that I ever need.

Still, a basic knowledge of algorithms, in addition to being interesting in its own right, helps you decide which collection class to use when.

Wednesday, December 4, 2002

Thank you all, I bought Weiss and ordered Sedgewick (as its reference for a small team including myself), already one of our developers ripped a shell sort out of Weiss replacing a bubble sort that he wrote, just for fun. When the data volume is large the speed difference is very noticable.

Many thanks.

Mike Wainright
Thursday, December 5, 2002

Here's some online references:

Lecture notes from a course.  Good for high level detail, but short on detail.

Lecture notes from another course.  The real gem here is that there are animations to demonstrate how the structures work.  The text is OK.

last but not least ...

Data Structures and Algorithms with Object-Oriented Design Patterns

The master referece, available in C++, Java and C# flavours.  Goes into great detail, and is very well written.  I'm planning to by the dead tree version soon.

Ged Byrne
Thursday, December 5, 2002

Hey Ged,

That is a cool book!

Prakash S
Thursday, December 5, 2002

Never used it, just know it is there.

CLR haas always been my reference book.

Prakash S
Thursday, December 5, 2002

*  Recent Topics

*  Fog Creek Home