Found in 5 comments on Hacker News
Or the newer book with Java code.

Robert Sedgewick also has fantastic algorithms courses on Coursera.

mikevm · 2013-12-06 · Original thread
What do you want to learn? Programming or CS? CS is more than just programming, and CS theory is more than just Algorithms & Data Structures.

If you want to learn about Algorithms and Data Structures and you have a strong math background, then CLRS is the book to get:

An undergraduate CS curriculum will mostly cover the parts I-VI of the book (that's around 768 pages) plus a few chapters from the "Selected Topics Chapter" (we covered Linear Programming and String Matching). Mind you, this book is very theoretical, and all algorithms are given in pseudocode, so if you don't know any programming language, you might have to go with a an algorithms textbook that is more practical. In my DS course we had to implement a Red-Black tree and a binomial heap in Java, and in my Algorithms course we only wrote pseudocode.

Maybe Sedgewick's (Knuth was his PhD advisor!) "Algorithms (4th ed)" will be a better choice for a beginner, as it shows you algorithm implementations in Java: (If you decide to go this route, you might as well take his two Algorithms courses on Coursera, they will really help).

There are also a bunch of Python-based introductions to computer science which have a broader focus than just teaching specific data structures and algorithms. Some of them emphasize proper program design, debugging and problem solving. I haven't read any of them, so I can't vouch for them, but here are a few of the more popular ones:


This book was written to go along with John's edX course:


Oh and btw, there's also the Theory of Computation, which is a major part of CS theory. Here are a few MOOCs and recommended books on the subject:






Sipser's book is probably the best introduction to the theory of computation, and I believe its last chapter deals with Complexity theory as well.


I loved this book very much. It has a very informal and conversational style (don't let it fool you, the problem sets can be HARD).


Once you are familiar with some computation models, its time to study computational complexity and this is one of the best books on the subjects. It is used both for graduate and undergraduate courses.

wasd · 2013-10-12 · Original thread
I've used Algorithms by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani for the course they teach at Berkeley and didn't like it at all. I'm a pretty big fan of Algorithms by Sedgewick. There is a class on Cousera is also taught by Sedgewick and uses the book. The first half of the book follows a traditional data structures course and the second half a traditional algorithms course.

Some people might find it as a downside but the book was written with Java in mind. I personally didn't mind this at all.

dhissami · 2013-05-04 · Original thread
Some other resources besides CLRS...

Free interactive Python textbook on Algorithms & Data Structures:

Robert Sedgewick and Kevin Wayne of Princeton have a great textbook (code samples in basic Java):

They also teach a two-part Algorithms course on Coursera:

Thomas Cormen (the C in CLRS) also has a new book called Algorithms Unlocked which introduces some popular algorithms in pseudocode.

Fresh book recommendations delivered straight to your inbox every Thursday.