Best algorithms book I ever read
eriwen.com
eriwen.com
I haven't read the new edition, but his older editions were very accessible. More for practitioners. For example, I don't think there were many, if any proofs (but I may be way wrong on that). A good amount of actual code though.
It is hard for me to take advice seriously from someone who says this.
"Whyyy is this variable, ★★p a pointer to a pointer?! p is never referenced in the function, so why are we two levels of indirection down?!" I didn't realize at the time that pointers are copied by value in C, so in order to modify the pointer you need to give the function a pointer to it.
I guess it was worthwhile, though, because it encouraged me to play around with C[1] a bit in order to grok it.
P.S. Sorry for those stupid stars, HN kept eating my highlights. Any way to avoid that?
int **p; /* I used 4 spaces in front of "int" */Also, anyone learning data structures should know pointers or at least references as a prerequisite. You can't reason about efficiency in data structures knowing only the high level comfort of Python.
EDIT: Though, that's not to say I wholly endorse CLRS. I think Knuth's The Art Of Computer Programming is more detailed and more mathematically rigorous than CLRS. Unfortunately TAoCP is multiple volumes, while CLRS manages to be a single (substantial) volume.
But I have to say that use some time to read CLRS and TAoCP is worthwhile. It will help u know more about algorithms and avoid the condition that just know how but not know why.
http://www2.algorithm.cs.sunysb.edu:8080/mediawiki/index.php...
Also, the course page has some interesting stuff as well (links to assignments, lectures, etc.):
Sedgewick's Algorithms is good for implementations in imperative languages. Okasaki's Purely Functional Data Structures is a nice introduction to some algorithms and data structures suitable in a purely functional setting. He also addresses laziness.
And finally for the theory, Schrijver's "Combinatorial Optimization: Polyhedra and Efficiency" tells you more about P and the boundary to NP than you ever wanted to know.
Those are just a few that I enjoyed, and I can't claim they are the best.
For example Structure and Interpretation of Computer Programs is definitely worth a read, but it won't help you with algorithms directly.
Unless you want them to implement a compiler or something, I think you'll learn a lot more about somebody's programming abilities by asking them to turn a list of use cases into a class diagram or write out a few SQL queries given for a given set of tables.
Google Chrome?
Adobe Photoshop?
Crysis 2?
An IPad?
A self-driving car?
Not all programming is boring business stuff with SQL and class diagrams. And even "boring" apps may be more tricky than they look: Microsoft Excel had its own bytecode interpreter, which definitely qualifies as "a compiler or something" :-)
Yes, I have. Admittedly, I had to do it much more often when STL was a toy.
But this is not the reason for this question, this is simple coding exercise, if a candidate can't do it without bugs in 10 minutes, there is nothing to talk about. Of course jobs not requiring writing C++, Java, C#, or Python code need different set of questions.
It provides an excellent middle-ground. It's not as hard-core as Cormen's "Introduction to Algorithms", which might be a good thing for some people (like me). I find that for myself, I can retain more information when i have a real world application to attach it to and this book does a great job providing those.
I loved the Stones quote. The book does have some bugs, if something doesn't look right, check the website errata.