Thoughts about software development

Algorithms

I just finished a fantastic book called “Algorithms”, by Sanjoy Dasgupta, Christos Papadimitriou and Umesh Vazirani. Even better: this book is free and can be downloaded in PDF form.

At 300+ pages, it’s not lightweight either, but the authors have done a fantastic job at explaining the main foundations of essential algorithms in simple terms that even developer who don’t have a CS degree will find easy to read and to absorb. You will see a few mathematics formulas and proofs here and there, but you can safely skip them if you are not comfortable with them and just take away the very natural and friendly wordings that the authors never omit to make when they are trying to get you to understand the overall idea behind an algorithm.

The book is very extensive and covers the most important algorithms you will ever come across in your life as a developer, starting with the introduction of the “big O” notation, and then progressively moving to more complex topics such as graphs, dynamic programming (nothing to do with dynamic languages), linear programming and culminating this area with the Simplex algorithm (I loved this section).

I would consider the chapters that follow as a “second part” of the book (even though it’s not structured as such) since they cover more advanced (and sometimes, still not completely understood yet) problems such as NP completeness and quantum programming.

A must-read for any developer who never got a chance to understand how all these algorithms work or who simply want to get a refresher…

And hats off to Sanjoy, Christos and Umesh for making such a great contribution to the computing world!

This entry was posted on December 7, 2006, 10:10 am and is filed under General. You can follow any responses to this entry through RSS 2.0.
Both comments and pings are currently closed.

This is what I think I had been looking for. I work in IT even though from Mech Engg background. Basic math and programming languages are enough for working in business oriented apps. But when interviewed in product development or big companies (Amazon, Oracle, Sun), I always ran into people asking me algorithm related questions. I wondered why and if they would really use those algorithms in day-to-day work or were just showing off to me. But now, I guess this will help me in that situation.

I agree with KK. I also lack a formal CS education (though I took a handful of programming course while in college). I’d estimate 95% of the time developing software is solving practical problems, usually involving human interaction with a system.
Soon I’ll be moving into a new job role as a java performance engineer (which is a fancy way of saying I’ll find inefficiencies in code and fix them). I feel very comfortable analyzing and refactoring code from a stylistic perspective, but think a better knowledge of basic computer operations would really help me out.
I just read through the first chapter and really enjoy this.
Thanks for the link Cedric.

I appreciate the desire expressed by some of these comments–to become a better programmer–but the concept of becoming a better programmer through algorithms kind of frightens me.
These are like tools. Imagine a plumber saying “I need to become a better plumber, I’m going to get a better set of tools”
IMO, to become a better programmer you really need techniques, not algorithms. If you are really looking for a book that helps you actually program better, I’d spend my time with Refactoring–esp. the “Bad Code Smells” section. I think that is one of the most insightful programming books I’ve read–and many interviewers actually ask about it these days.
Not that this doesn’t sound like an excellent book, but I’d consider it a great read and an excellent reference, but perhaps not something that will take your programming to the next level. It looks like it will also grease your mind up and give your imagination something to work on which is always good for an engineer.

I have to disagree with Bill Kress. All computer programs are basically algorithms, therefore, understanding algorithms allows one to understand the basis or foundation on which their programs are built. A better analogy may be your plumber trying to understand pipes and water better.
I would say that Refactoring is the tool and algorithms is the understanding. One I understand how the algorithms work (either the ones in the book or ones I create) then I can apply the tool of refactoring and make those algorithms better.
When I was taking my CompSci degree, the first thing the prof said to us in my first comp sci course was that we were not there to study programming; we where there to study algorithms.

I have to disagree with Bill Kress. All computer programs are basically algorithms, therefore, understanding algorithms allows one to understand the basis or foundation on which their programs are built. A better analogy may be your plumber trying to understand pipes and water better.
I would say that Refactoring is the tool and algorithms is the understanding. One I understand how the algorithms work (either the ones in the book or ones I create) then I can apply the tool of refactoring and make those algorithms better.
When I was taking my CompSci degree, the first thing the prof said to us in my first comp sci course was that we were not there to study programming; we where there to study algorithms.

Perhaps you are right. I kind of assumed a certain level of understand of algorithms in computer engineers.
I was seeing from a certain angle–like the encryption portion is really useful if you are coding encryption, but not so much otherwise–and even then 99% of people dealing with “Encryption” are using libraries, only 1% (if that) are going to be coding them.
Regardless, It’s a great book. I’ve been reading pieces of it all day–thanks!

Thanks for the link, will take a look.
A good way to learn *many* algorithms and techniques: try to be a “yellow” (or red) coder in TopCoder’s online competitions… You won’t get there without having a strong understanding of memoization, DP and you need to know a *lot* of algorithms. That’s the company Google is teaming with to organize the Google Code Jam btw.

Thanks for this link Cedric !
It was pointed out to me by many people that seems to have really enjoyed reading it !
Your name is quite familiar to me … did we fight on xtrek some years ago … the last century ? you were “Real” ?