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
Recursion
Reversing Strings
Managing Queues and Stacks
plus lots more

All in one huge reference book, or library.

Mike Wainright
Wednesday, December 04, 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 04, 2002

My favorite is "Introduction to Algorithms":

http://www.amazon.com/exec/obidos/tg/detail/-/0262032937/102-1854524-9936957

Donald Knuth has an excellent set of books on algorithms:

http://www.amazon.com/exec/obidos/ASIN/0201485419/102-1854524-9936957

Another good reference is the set by Robert Sedgewick:

http://www.amazon.com/exec/obidos/ASIN/0201756080/102-1854524-9936957

me
Wednesday, December 04, 2002

There's also the Collected Algorithms of the ACM:
http://www.acm.org/calgo/

not me
Wednesday, December 04, 2002

I'll second the recommendation Weiss's books.


Wednesday, December 04, 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 04, 2002

i second (third?) the sedgewick set.

algorithm
Wednesday, December 04, 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.

Julian
Wednesday, December 04, 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 05, 2002

Here's some online references:


Lecture notes from a course.  Good for high level detail, but short on detail.
http://www.ics.uci.edu/~eppstein/161/syl.html

Lecture notes from another course.  The real gem here is that there are animations to demonstrate how the structures work.  The text is OK.
http://ciips.ee.uwa.edu.au/~morris/Year2/PLDS210/ds_ToC.html

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.
http://www.brpreiss.com/books/opus4/

Ged Byrne
Thursday, December 05, 2002

Hey Ged,

That is a cool book!

Prakash S
Thursday, December 05, 2002

http://www.aduni.org/courses/algorithms/

Never used it, just know it is there.

CLR haas always been my reference book.

http://www.amazon.com/exec/obidos/ASIN/0262032937/qid=1039089248/sr=2-1/ref=sr_2_1/002-6088473-7517660

Prakash S
Thursday, December 05, 2002

*  Recent Topics

*  Fog Creek Home