5 ms·
Seems like the other book people recommend is "Introduction to Algorithms" by Cormen et al, so that the main problem in choosing an algorithms book is really de
by westoncb 12y ago
Seems like the other book people recommend is "Introduction to Algorithms" by Cormen et al, so that the main problem in choosing an algorithms book is really deciding between that one and this one.
I've spent more time with the Cormen book so far and only a little with "The Algorithm Design Manual", but have to say I've been disappointed with Cormen and very impressed by the ADM.
I think the Cormen book has a reputation for being more serious, and it does give more in-depth mathematical treatments of the algorithms covered—but honestly, I think it's a mistake to consider it more serious for that reason. There's a time where I would have stopped reading this comment and ordered the Cormen book, but I think it's worthwhile to consider criteria for a book being serious. In the realm of software, I'll argue that the most important measure is how much the book improves your ability to create serious software—and under those conditions, The Algorithm Design Manual takes the prize.
In case there's still ambiguity on what 'serious software' might mean, I'll point out that the ADM is not a recipe book—I'm not trying to say, "practically speaking the algorithm problems in software are solved, you just have to copy and paste the source for the required algorithm." For crafting difficult, original algorithms, I still think ADM will be more useful.
- flebron 12y agoI also spent more time with CLRS, I've had my copy for close to a decade now :) I found ADM to be much less useful. It was mostly a small bit of code per concept, with little explanation or proofs or information about why it worked. If I wanted to copy and paste code, I wouldnt've gotten a book, I'dve searched Google. I'm much more comfortable with the knowledge I obtained from CLRS, because I know not just how to code the things (since there's pseudocode for them) but why they work, and how to debug things when they break. Overall, whereas I'd class CLRS as one of the best purchases I've ever made (in terms of dollars/use of the product), I'd class ADM as one of the worst, and that's even considering it was like $5 used :)
- westoncb 12y agoI think this sample exemplifies what ADM is quite good at: "Why is sorting worth so much attention? There are several reasons: • Sorting is the basic building block that many other algorithms are built around. By understanding sorting, we obtain an amazing amount of power to solve other problems. • Most of the interesting ideas used in the design of algorithms appear in the context of sorting, such as divide-and-conquer, data structures, and randomized algorithms. • Computers have historically spent more time sorting than doing anything else. A quarter of all mainframe cycles were spent sorting data [Knu98]. Sorting remains the most ubiquitous combinatorial algorithm problem in practice. • Sorting is the most thoroughly studied problem in computer science. Literally dozens of different algorithms are known, most of which possess some particular advantage over all other algorithms in certain situations. In this chapter, we will discuss sorting, stressing how sorting can be applied to solving other problems. In this sense, sorting behaves more like a data structure than a problem in its own right. We then give detailed presentations of several fundamental algorithms: heapsort, mergesort, quicksort, and distribution sort as examples of important algorithm design paradigms." This kind of information on context is much more difficult to find than proofs. The idea that sorting algorithms are good, stripped down exemplars of general purpose algorithm concepts is something I've never heard pointed out elsewhere—and the text is full of these golden, context-related insights. Once you have a firm grasp of the principles involved, then CLRS or google become useful references (though, tbh, it's extraordinarily rare I find myself reaching for CLRS over google). I just tested and it took me less than 15 seconds to find a proof for the running time of mergesort, which is basically all that CLRS offers over ADM.
- dxbydt 12y ago>This kind of information on context is much more difficult to find Yes, but its also highly subjective & imho useless information. Emanuel Derman often writes about this problem, and it is something I have observed very frequently at workplaces - this present generation seems to be obsessed with meta-knowledge rather than actual knowledge. He points out its better to know a few things but know them indepth, rather than have an ability to talk about everything without actually knowing what those things really are. When I ask people to implement ordinary least squares from scratch, literally like 5% of the people interviewed manage to do that, & they are very, very good. The remaining 95% "know about ols" but don't "know ols" ie. they will give me lots of mumbo jumbo about how ols is the building block of statistics & how it is affected by outliers & so forth - but can't implement one to save their lives. When it comes to sorting, I vastly prefer somebody who can implement atleast one of O(n) ( postman sort), O(n^2) ( bubblesort) or O(nlogn) ( mergesort, several others ) rather than somebody who can give me all this context & then say I will google the actual algorithm. CLRS teaches you how things actually work. ADM is imho good for acing interviews conducted by managerial types (PMs/EMs) who want you to namedrop & give lots of context & color without actually doing any real work.
- deleted 12y ago[deleted]
- westoncb 12y agoI can understand your complaint here, and I agree with you that people can easily go too far in the direction of 'when to implement' versus 'how to implement'—but I'm pretty sure the key is (1) Both are required, (2) it makes more sense for one of these things to precede the other. However, I think that you’re also conflating two approaches to learning ‘context.’ One gives people an elaborate index for finding implementations when required, so that they become capable ‘solution googlers.’ This is unquestionably an inadequate approach to education. However, there is another approach to context which emphasizes principles. ‘Principles’ can be a vague word itself, but I’ll try to be more precise about it: you have understood something ‘by principles’ when you first understood a more general structure, then, in order to learn the more particular thing, you understood which parameters must be supplied to the more general structure in order to get the more particular one. E.g., you learn principles of programming languages first, then can understand new languages as parameterizations of your prior, more general knowledge. I think the context material in ADM serves as a nice guide for acquiring principles in this sense. The bit I quoted is largely significant because of their emphasis on principles. It’s interesting that you think ADM would be the book for faking an interview. I have the exact opposite stance. If I wanted to impress a typical software person (e.g. a yet to be determined interviewer), I’d learn a lot of the details from CLRS, rather than going for ADM.
- anonymyous 12y agoI have had strong opinions about the same, which have fluctuated drastically over time and now settled on less stronger opinion. I was from an EE background and didn't have an algorithms course in our curricula (did my bachelors in India, so you don't usually have a lot of options of taking the courses you like). So I hated CLRS and like Skiena (though couldn't appreciate it well enough). Later on, went to grad school and had a amazing teacher and I was hung over theoretical text books (CLRS etc) and swore by them. Now I was teaching algorithms to couple of colleagues (again from non-CS) background, and initially tripped by suggesting CLRS. They are way more happier with Skiena. I guess, for some people applications inspire the theory and then theory take over. For others, they fall in love with theory naturally (or with good teachers). So my current take is, you probably want to go thru both the books if you want to code/think in algorithmic way. The order is going to depend on the person.