HN Books @HNBooksMonth

The best books of Hacker News.

Hacker News Comments on
The Algorithm Design Manual

Steve S. Skiena · 1 HN points · 12 HN comments
HN Books has aggregated all Hacker News stories and comments that mention "The Algorithm Design Manual" by Steve S. Skiena.
View on Amazon [↗]
HN Books may receive an affiliate commission when you make purchases on sites after clicking through links on this page.
Amazon Summary
This volume helps take some of the "mystery" out of identifying and dealing with key algorithms. Drawing heavily on the author's own real-world experiences, the book stresses design and analysis. Coverage is divided into two parts, the first being a general guide to techniques for the design and analysis of computer algorithms. The second is a reference section, which includes a catalog of the 75 most important algorithmic problems. By browsing this catalog, readers can quickly identify what the problem they have encountered is called, what is known about it, and how they should proceed if they need to solve it. This book is ideal for the working professional who uses algorithms on a daily basis and has need for a handy reference. This work can also readily be used in an upper-division course or as a student reference guide. THE ALGORITHM DESIGN MANUAL comes with a CD-ROM that contains: * a complete hypertext version of the full printed book. * the source code and URLs for all cited implementations. * over 30 hours of audio lectures on the design and analysis of algorithms are provided, all keyed to on-line lecture notes.
HN Books Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this book.
This is my personal recommendation, please notice that I have read "Introduction to Algorithm by Cormen" about 4 years ago, so for me everything was more a catch up than really learning:

- Skiena algorithm book: https://www.amazon.com/Algorithm-Design-Manual-Steve-Skiena/...

for this book one can focuses on the first 7 chapters (revision)

- Leet code editorial solutions https://leetcode.com/articles/ . They provide with the solution and complexity analysis of a few problems. I suggest you try to solve and give your complexity analysis then compare it with the "official" one.

Dec 16, 2013 · 1 points, 0 comments · submitted by jparishy
Nov 06, 2012 · unoti on [Missing Story]
Fantastic and inspiring. You should really consider getting this book: http://www.amazon.com/Algorithm-Design-Manual-Steve-Skiena/d... It's super fun to figure everything out for yourself, but I guarantee you that if you read this book, it'll blow your mind and have you off to the races trying a hundred fascinating things.
When I interviewed, I studied this book cover to cover for 3 months prior to the interview. It definitely came in handy: http://www.amazon.com/Algorithm-Design-Manual-Steve-Skiena/d...

There's also lecture videos here: http://www.cs.sunysb.edu/~algorith/video-lectures/

Learning data structures that you don't use often, like bit arrays, come in handy for interviews, especially for when they ask you to optimize your solution. (http://en.wikipedia.org/wiki/Bit_array)

I would strongly urge the OP to not use this book. I used it as my undergrad algorithms book and it is, quite frankly, far too obtuse and hard to understand. At first, I thought it was just me and that other people found the book readable. I eventually realized that the book itself is just bad for autodidacts.

Last month (about 5 years after I took the course), I went through to review some stuff that I'd looked at more recently. Specifically, I had worked out Dijkstra's algorithm on my own and finally understood how the heck it actually worked. I then opened CLRS to check their proof. What I saw blew my mind in terms of sheer obfuscation. Despite having a very clear understanding in my head of the core concept behind the algorithm, I read their proof and was just amazed at how little it actually explained about the simple idea that ties the whole thing together. That by itself isn't a huge deal, because some proofs are just hard to follow. What really upset me was that there was practically no surrounding discussion of the intuition behind the algorithm. Behind all the rigor of mathematics lies very simple and powerful ideas. This book did nothing to emphasize those simple ideas. It's a real travesty to be honest :(

If you're looking for something more accessible, I've heard that The Algorithm Design Manual[1] by Steve Skiena[2] is better. Whatever you choose, though, please stay away from CLRS.

[1] http://www.amazon.com/exec/obidos/ASIN/0387948600/ref=ase_th...

[2] http://www.cs.sunysb.edu/~skiena/

edit: I just found this review of CLRS on Amazon (http://www.amazon.com/review/R2FI8CA368KWGE/ref=cm_cr_pr_per...). It's the top comment for this book and sort of gets at the issue:

With that said, this book falls short in one MAJOR area, explanations. Too often explanations are left out and left as exercises and there are no solutions to the exercises! Or details are replaced by ambiguous statements such as of "cleary, this works", or "it is easy to see that this ...". I get the concept of learning by doing, really I do, but there should be some kind of solutions so the student can CHECK his/her understanding of the material and sometimes the exercises are not about advanced aspects of a concept, sometimes it is the core material. Even if the solution manual only contained a simple answer without the work. Not only would it help tremendously but the purpose of doing the exercises would be preserved; that is the student getting his/her "hands dirty" and working out a problem.

For the love everything good and pure in this universe, I really wish writers of mathematical books would stop using statements like "clearly this works" or "it is easy to see", "it is obvious" etc. While that may be true for you and your brilliant circle of colleagues, everything is not always clear and obvious to your readers. Save all of that ambiguity for your research paper.

A great book should deliver in two areas; it should challenge and it should inform. The challenge is there, no doubt. However in some ways it fails to inform the reader. The authors should really think about releasing a students solution manual to help students learn better. I take away two stars for the reasons stated about

brianmwaters
> What really upset me was that there was practically no surrounding discussion of the intuition behind the algorithm. Behind all the rigor of mathematics lies very simple and powerful ideas. This book did nothing to emphasize those simple ideas.

I would just respond to this by saying that the mathematics do express the ideas. It's just a different language than most people are used to.

elemeno
As far as The Algorithm Design Manual and CLRS is concerned I would not say that they are comparable.

CLRS is about algorithm analysis and formally proving that they behave in certain ways - like proving that quicksort has a guaranteed worst case of O(n^2) and an average case of O(n log n). Being able to work with proofs such as those is fairly fundamental to being a Computer Scientist in the strict, academic, sense. That being said, it should not be used as book to teach data structures or algorithms without formal proofs having been taught first - without the maths background the book is going to be very hard going.

The Algorithm Design Manual on the other hand, is more like a literature review for a collection of algorithms/families of algorithms (75, claims the copy infront of me). For each of them it gives an overview of the class of problems you'd apply the algorithm to, a run through of the algorithm (some with pseudo code) and discussion about the algorithm and times when the author has used it, and then pointers to more in depth sources. CRLS and Knuth are cited considerably, which should give you an idea about the relative stature of the two books being compared here.

Ultimately, they're both good books but for different audiences. The Algorithm Design Manual is by far the easier read, not least of which because it's not trying to be an academic text and is replete with anecdotes from the author. It's an excellent overview of the techniques available to the practicing developer - the ones who work in fields where you might need to whip up a quick Bin Packing routine anyway. CLRS is a lot harder to get through, but it will teach you how to prove that your algorithms will do what they should.

When it comes down to it, I'd say that CLRS is for the Computer Scientist while TADM is for the practitioner and I'm glad I own both.

http://www.amazon.com/exec/obidos/ASIN/0387948600/ref=ase_th... might work better for some.
SkyMarshal
And also its awesome home page: http://www.cs.sunysb.edu/~algorith/

Click through to some of the actual algorithm pages, for instance the Traveling Salesman Problem: http://www.cs.sunysb.edu/~algorith/files/traveling-salesman....

Great book, great site.

Hitchhiker
Absolutely. Think they have a kindle edition out too.. its going to be cheaper.

The book hits the sweet spot for most practical folks and also has great theoretical connectors / flow.

After someone spends around six months of working / implementing things out of joy, you will be able to discern what to keep or reject from other sources.

estel
The Kindle version is of the 1998 edition and is available in the US only; which is more than a bit rubbish.
Hitchhiker
err.. I am based in Australia, got the 2008 / 2nd edition on kindle just fine.

another url -> http://www.algorist.com

krzyk
And has unfavorable reviews on amazon. I'll wait for the second edition on Kindle.
alttag
So? I've on occasion changed my Kindle account address to the U.K. (Amazon's office in Slough, more specifically), ordered a U.K.-only book (back when AMZN and the publishers were having their public spat) and changed my address back. I suspect the same might work in reverse.

It's a kludge, but it works.

prithee
Steven Skiena was one of the most enlightening professors I've had the pleasure to be lectured at during my education at SUNY Stony Brook.

It is worth mentioning that further within this link he has posted video lectures from 1997 and 2007, along with audio and presentation slides:

(Analysis of Algorithms Course):

http://www.cs.sunysb.edu/~algorith/video-lectures/

(Programming Challenges Course):

http://www.algorithm.cs.sunysb.edu/programmingchallenges/

chollida1
related to the url givem: http://www.amazon.com/exec/obidos/ASIN/0387948600/ref=ase_th...

Does any one know what the "ref=ase_thealgorithmrepo/" at the end of the url means? If I remove it, it doesn't seem to change anything.

jisaacstone
tracking what you clicked on to get to the product page.

does not change the page itself. If you want to have fun you can change it to "ref=monkey_poo" as I am wont to do.

chollida1
Does this mean they would get any affiliate commission if I buy the book through this link?

Seems like it would be nice to help them out.

Hitchhiker
bless the author then, to solve the mystery, the referral code is simply the one here :

http://www.cs.sunysb.edu/~skiena/#books

chollida1
Thanks!

To be clear, I wasn't trying to imply anything sneaky going on. I was curious as to what these parameters mean :)

I appreciate the response

Hitchhiker
I second him. My entry "ref=kung_fu_panda" impacts a mysterious star somewhere in Messier 36.
nitrogen
So does this mean one could earn affiliate revenue from your purchases by registering as an affiliate called monkey_poo, or do they not allow you to choose your ID?
mcoffee
It's a referral id. It basically tells Amazon who sent you; in this case "thealgorithmrepo", which is probably the folks in SkyMarshal's link below.
DrHankPym
Would totally buy if there was an e-book version.
ianbishop
I personally learned from Skienna's other book Programming Challenges first (http://www.amazon.com/Programming-Challenges-Steven-S-Skiena...). Then when my knowledge had matured a bit, I was able to digest The Algorithm Design Manual a little better.
Hitchhiker
In case you've not already, head toward http://www.cs.cornell.edu/home/kleinber/ and experience further bliss.
This dictionary looks like it's the index of The Algorithm Design Manual by Skiena: http://www.amazon.com/Algorithm-Design-Manual-Steve-Skiena/d...
arasraj
I was thinking the same thing. The catalog of algorithms at the end of the book is indispensable.

This site does seem to cover a much broader range of algorithms though.

This is good advice.

Also to the OP: this book is good, and a must read. It will help you a lot on the fundamentals of CS. http://www.amazon.com/Algorithm-Design-Manual-Steve-Skiena/d...

I found Skiena's: http://www.amazon.com/Algorithm-Design-Manual-Steve-Skiena/d... to be much more readable, but Cormen's is still considered THE bible algorithms anyway.
I haven't read Knuth but I recommend http://www.amazon.com/Algorithm-Design-Manual-Steve-Skiena/d...

From what I understand Knuth uses MIX assembly language to imlpement his algorithms. Contrast this to the Skiena book which uses C++. I found this to make it very practical.

Though to be fair, I don't think it offers near the depth of the Art of Computer Programming:)

wingo
You can run MIX programs using the GNU MIX Development Kit:

http://www.gnu.org/software/mdk/

michael_dorfman
It's actually a common misconception that Knuth uses MIX/MMIX to implement his algorithms. The vast majority of the algorithms are described in English, and the MMIX implementation is usually only given when there are relevant implementation details to be discussed. MMIX is just an idealized machine language, and it is trivial for a reader to implement the algorithms described in the programmer's language of choice. (This is assuming that the objective is to learn CS, not to have a cookbook of ready-to-run algorithms to pilfer....)
amackera
YES! Thank you for this clarification.

I personally enjoy thinking about the implementations, instead of looking at the code itself. Knuth makes that easy (hard?) by not spoon feeding you.

Plus the typography of Knuth's books is so wonderful. It's a pleasure to read.

michael_dorfman
I'll also add that I usually recommend that newcomers begin with Volume 4, and turn to the earlier ones later. I think that for many people, skipping the preliminaries, and starting with an interesting and relevant topic (combinatorial algorithms) gives more immediate pleasure than beginning with the lower-level underpinnings.
tjr
Readers might also consider Knuth's "Concrete Mathematics" as a substitute for the more-or-less equivalent material in Volume 1, especially if a little more help is needed in understanding it.
chollida1
Sorry if this seems dense but I can't reconcile what your saying and I've not read the book. You say:

> It's actually a common misconception that Knuth uses MIX/MMIX to implement his algorithms.

So you state very clearly that he doesn't use MIX to code his algorithms.

But then you say:

> and the MMIX implementation is usually only given when there are relevant implementation details to be discussed

So you say that he does actually use the MIX language.

Do you mean that most algorithms aren't presented in source form at all and only the few that are actually coded are in the MIX language?

notaddicted
Yes, that is how it is.

For example the first algorithm in the book (found via google):

Algorithm E ( Euclid's algorithm). Given two positive integers m and n, find their greatest common divisor, that is, the largest positive integer that evenly divides both m and n.

E1 [Find remainder.] Divide m by n and let r be the remainder. (We will have 0 ≤ r < n)

E2 [Is it zero?] If r=0, the algorithm terminates: n is the answer.

E3 [Reduce.] Set m← n, n← r, and go back to step E1.

gilesgoatboy
If you're going to do Euclid's algorithm, cut to the chase and read Euclid. Nothing will ever teach you more about logic.
chollida1
Thanks for the clarification:)
This is the single best text I've seen on algorithms in the real-world: http://www.amazon.com/Algorithm-Design-Manual-Steve-Skiena/d...

Can't recommend it enough.

darkxanthos
I just bought this book and have been reading it for a few days and it really is pretty good. The best thing about it are the numerous practical examples and the "War Stories" that show you how real people determined they really needed to use algorithm xyz.
zain
Here's the second edition from 2008: http://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena/...
pkrumins
Thanks! I did not know there was the 2nd edition!
Oct 02, 2007 · amichail on Algorithm Basics?
How about this?

http://www.amazon.com/Algorithm-Design-Manual-Steve-Skiena/d...

raju
Thanks amichail. I will look into it. It does look interesting.
HN Books is an independent project and is not operated by Y Combinator or Amazon.com.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.