
Ask HN: Help me choose the best first book for Algorithms - learnerburner
I am a programmer and no formal CS knowledge. I have the following books on the topic Algorithms&#x2F;DataStructures. Can you please help me pick the first one to start so that I am able to get up to the speed. It will be great if you can specify an order as well.<p>* The Algorithm Design Manual 
by Steven S Skiena 
Link: http:&#x2F;&#x2F;amzn.com&#x2F;1848000693<p>* Algorithms (4th Edition) 
by Robert Sedgewick et al. 
Link: http:&#x2F;&#x2F;amzn.com&#x2F;032157351X<p>* Algorithm Design 
by Jon Kleinberg et al. 
Link: http:&#x2F;&#x2F;amzn.com&#x2F;0321295358<p>* Introduction to Algorithms, 3rd Edition 
by Thomas H. Cormen et al. 
Link: http:&#x2F;&#x2F;amzn.com&#x2F;0262033844<p>* The Art of Computer Programming, Volumes 1-4A Boxed Set 
by Donald E. Knuth 
Link: http:&#x2F;&#x2F;amzn.com&#x2F;0321751043
======
emmanueloga_
[http://algs4.cs.princeton.edu/home/](http://algs4.cs.princeton.edu/home/) is
my favorite. The implementations of the algorithms are really nice (quite a
feat, considering the lang is Java :-p) and each section builds on top of a
previous one, when needed (e.g. many algorithms require a Symbol Table, which
is built in one of the chapters of the first volume). The resulting
implementations are incredible terse but at the same time clean and easy to
understand!

Cormen's book is a bit more thedious to read and I don't know it that well but
I think is a _little_ bit more rigorous with math. Sedgewick's book doesn't
mention asymptotic limits or BigO notation, rather talks about the run time /
memory requirements in more informal terms, like "run time being proportional
to the square of the number of input items", etc. But, there's another book
from Sedgewick (and Flajolet!) if you want to go deeper into analysis: (1).

Skienna's book is great to have a wider outline on all sorts of algorithms,
including some less widely known and (I think) not covered in either of
Sedgewick's or Cormen's book. It is, if I'm allowed the pun, more of a breadth
first than a depth first approach to the subject.

1: [http://www.amazon.com/Introduction-Analysis-
Algorithms-2nd/d...](http://www.amazon.com/Introduction-Analysis-
Algorithms-2nd/dp/032190575X)

~~~
rajathagasthya
Agree. Sedgewick's book is great especially because of the implementation. I'd
also highly recommend his lectures on Coursera - Algorithms Part I and II. He
explains the working of algorithms with animation, which makes it really easy
to understand the algorithms.

~~~
ruraljuror
Algo I ended recently, although it is available for a limited time. It will be
back in the fall. I am very much looking forward to that and will definitely
try to dedicate the time.

FWIW, the Sedgwick textbook is available on Safari.

------
apstls
Sedgewick and Kleinberg are both solid introductory books that are well-suited
for someone with little CS knowledge. The Algorithm Design Manual is a great
book, but seems to focus more on giving a tour of different problem types and
their associated algorithms than developing a deeper understanding of the
theory behind it all. Cormen's book is fantastic and very thorough, but may be
a bit harder to soak in for a beginner. Finally, while TAOCP could probably be
considered the most revered texts on CS, they are not well-suited for a
beginner trying to get their feet wet.

All in all, I'd say Sedgewick is the best of these options.

~~~
learnerburner
Are Sedgewick and Kleinberg on the same level? So if I do one can I skip the
other and move to say Algorithm Design Manual or CLRS?

From your comment it seems Knuth's book(s) to be the last (and for the
mastery.

~~~
apstls
They're on roughly the same level but focus on somewhat different things.
Sedgewick spends a lot of time on basic data structures like hash maps and
search trees, as well as elementary algorithms like search and sorting, in
great detail. Kleinberg instead approaches things more generally by tackling
concepts by design technique - greedy, divide-and-conquer, dynamic, etc - and
doesn't focus as much on the very basics. Kleinberg also spends a lot more
time on more advanced topics like NP completeness, randomized algorithms, etc,
while Sedgewick again keeps his focus on the more elementary topics.

CLRS contains pretty much everything contained in both Kleinberg and Sedgwick,
so the two are essentially interchangeable in the sense that Kleinberg+CLRS
contains roughly the same breadth of information as Sedgewick+CLRS. Since
Sedgewick takes more time to explain the basics thoroughly, I'd say it's
probably your best starting point.

Good luck!

------
bozoUser
[https://www.cs.berkeley.edu/~jrs/61b/](https://www.cs.berkeley.edu/~jrs/61b/)
this course by Prof. Jonathan Shewchuk is by far the best I have come across.
Even the course is in Java, I really like the way he lays out all the basic
data structure family.

The youtube videos are the icing on the cake as you can get thru them faster
than compared to reading a book, if you are starting off I would highly
recommend these youtube tutorials.

------
seiji
Start with The Algorithm Design Manual and understand everything it says. Then
try some exercises and re-read the entire book again. Use google to study any
math in TADM you don't understand up front.

TAOCP isn't for reading from cover to cover and, arguably, neither is CLRS
(especially for "first time through" studies).

------
learnerburner
I have some results and there seems to be a consensus for Sedgewick's. There
was a course on Coursera mentioned.

Close second is Kleinberg's and Skiena's.

TOACP and CLRS apparently are considered reference reads and not starting
material.

I think I know pretty much where to start. Thank you all.

------
ruraljuror
Does anyone have any opinions on or experience with the MIT OCW Intro to Algo
class? [http://ocw.mit.edu/courses/electrical-engineering-and-
comput...](http://ocw.mit.edu/courses/electrical-engineering-and-computer-
science/6-006-introduction-to-algorithms-fall-2011/)

------
CephalopodMD
For learning - Kleinberg

For reference - Cormen

------
33a
CLRS is the way to go.

