

Algorithm Basics? - raju

To all hackers out there. I am a self taught programmer who wants to start with the very basics of algorithms and data structures. I took a look at "Introduction to Algorithms" but it came across as more academic than practical. Any suggestions?
======
plinkplonk
"start with the very basics of algorithms and data structures" ,"more academic
than practical", "something to get my hands dirty with vs mathematical
theories" etc _seems_ to me to indicate that you want to write code rather
than work with proofs, runtime analysis etc.

Take it from someone who tried this path and failed. In algorithms, the long
path is the shortest path.

If I were advising someone on how to go about learning algorithms today, I
would ask him to first learn the basics of proofs ("The Hsskell Road to Logic
Maths and Programming" by Doets and Van ejck is a good book as is Velleman's
"How To Prove It"), then work through (at least) the first three chapters of
Knuth et al's "Concrete Mathematics" - to get a handle on recurrences - and
then tackle "Introduction to Algorithms" , probably supplemented by Skiena's
"Algorithm Design Manual".

Avoiding the "academic" parts is (imho) a big mistake. As with compilers, the
core of algorithms __is __"academic" and you can't avoid that (imho).

And once you get your head around proofs etc you may find this aspect a lot of
fun. I certainly did.

my 2 cents. fwiw.

~~~
raju
I have an engineering degree, both undergrad and masters, so I am well versed
with proofs. After all the suggestions fellow hackers have put in (including
you), I am convinced to pick up "Introduction to Algorithms" and take it from
there.

Thank you (all of you). Though I think this was the answer I was looking for.

------
jey
"Introduction to Algorithms" by Cormen, et al came across as not practical?
That book is personally my favorite. What are your criteria when judging a
book as practical?

As someone else mentioned, you might like Sedgewick's books, but it's hard to
tell without knowing what your criteria are.

~~~
raju
Hey jey, I came across that book at the local bookstore, and perused it for a
while. What I meant by practical was a book that gave me something to get my
hands dirty with vs mathematical theories, thats all. Maybe that was a little
shortsighted, and considering a lot of the other comments suggest the very
same book, I will take a look at it again. Thanks!

~~~
timr
Algorithms _are_ mathematical theories. You're not going to be able to learn
them through code alone.

There are certainly less dense introductions to the subject, but Cormen is the
classic that you'll see on every good programmer's shelf (and they even read
it, too!)

Edit -- "Data Structures and Algorithm Analysis" by Mark Allen Weiss is an
example of a common, less-dense introductory text. It's actually not bad,
given its intent.

~~~
falsestprophet
What other books does every serious programmer need?

~~~
timr
Are you being snarky or sincere? It's a good question, if it's an honest one.

~~~
falsestprophet
No please. I am a slowly reforming chemical engineering student.

------
nickb
I have a grad degree in algorithms and the best book on algorithms is Cormen
et all's "Introduction to Algorithms". You will be able to keep this book
around forever and you won't outgrow it that easily. Definitely the best book
on algos and an excellent reference.

<http://projects.csail.mit.edu/clrs/>

Google Books:
[http://books.google.com/books?id=NLngYyWFl_YC&dq=&pg...](http://books.google.com/books?id=NLngYyWFl_YC&dq=&pg=PP1&ots=BvWnDC2fI7&sig=p_2EGqf4Kw-A1ukQXUhgJ6LiVN8)

------
dpapathanasiou
Take a look at this: <http://www.cs.berkeley.edu/~vazirani/algorithms.html>

~~~
raju
From the site it looks like the book is yet to be published, but its available
in print...<http://tinyurl.com/2kg6to>

Though having the draft is quite nice...Thank you

~~~
dpapathanasiou
_Though having the draft is quite nice_

Yes, it certainly gives you get a sense of their approach to the subject (as
one of Amazon reviewers said it's not a substitute for CLRS, but a good
supplement).

------
omouse
Robert Sedgewick's _Algorithms_ :

<http://www.amazon.com/exec/obidos/ASIN/0201066726>

~~~
ivankirigin
Sedgewick is good. I learned a lot from this book, which is tailored for C++
[http://www.amazon.com/Algorithms-C%2B%2B-Parts-1-4-Fundament...](http://www.amazon.com/Algorithms-C%2B%2B-Parts-1-4-Fundamentals/dp/0201350882/ref=sr_1_2/103-1426490-1539834?ie=UTF8&s=books&qid=1191341985&sr=1-2)

~~~
omouse
I'm the process of reading the _Algorithms_ book and converting some of the
functions to Scheme :D

------
dyu
I agree with CLRS.

It might be good to look into the mathematical side of the algorithms though,
so that you know how they work inside. This way, you can manipulate the
algorithms and fine tune it to something you want later on.

------
adsyoung
MIT's Intro to Algorithms class lectures are a available in video:
[http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-
Compute...](http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-
Science/6-046JFall-2005/LectureNotes/index.htm)

------
orph
Find a problem you want to solve, ideally in a public project with good senior
maintainers... you'll learn everything you need by doing.

~~~
donna
orph recommended being an apprentice, which is a good approach

------
brent
I have to agree that CLRS is probably the most thorough, but as a bare
introductory book to someone learning on their own (who probably is not
currently in a computer science program) I would recommend Introduction to the
Design and Analysis of Algorithms by Anany Levitin. Good luck!

------
tojileon
<http://en.wikipedia.org/wiki/List_of_data_structures> and
<http://en.wikipedia.org/wiki/Algorithm>

------
smg
Go to the source "Art of Computer Programming" Get your hands dirty with MIX

~~~
jey
I hope the parent comment is intended to be sarcastic.

If you're not familiar with _The Art of Computer Programming_ ("TAOCP"), it is
an unreadable dense and heavily theoretical treatment of much of the
fundamental data structures and algorithms in CS. It's definitely a classic,
but I wouldn't try to learn from it if I wanted to be 'practical'. TAOCP is
much worse than Intro to Algorithms in readability and practicality.

The most practical use for TAOCP is to display it prominently on your
bookshelf to impress your colleagues. :P

~~~
Kaizyn
A friend of mine is buying the full set of Knuth's books because some
algorithms are only discussed here. So if you're a completist, these are for
you.

~~~
jey
I have yet to find a use for a tape sorting algorithm. ;-)

Yes, TAOCP is comprehensive and thorough. It's a useful resource, but pedantic
and difficult.

------
amichail
How about this?

[http://www.amazon.com/Algorithm-Design-Manual-Steve-
Skiena/d...](http://www.amazon.com/Algorithm-Design-Manual-Steve-
Skiena/dp/0387948600)

~~~
raju
Thanks amichail. I will look into it. It does look interesting.

------
pius
+1 for CLRS. You may run into CLR, but that's an older edition

------
eru
How about the Wizard book? It's not so much centered on algorithms - but about
how to organize your programs.

Or is it to hard for a beginner?

------
queensnake
Anyone else annoyed at these "I'm not a programmer, no that's too hard, make
me a programmer the easy way" posts?

~~~
dpapathanasiou
I'm not sure the O.P. fits that profile.

Also, none of the books recommended here fall into the "Learn Blub in 21 Days"
category.

~~~
queensnake
Yeah you're probably right, I'm just irritable.

------
henning
You might need something one step below CLRS. Try a good CS2 book.

The only algorithms I use regularly at a boring blub coding job is quicksort
and binary search. The only data structures I use are hashes, arrays, and
binary trees. Other niche data structures like tries, Bloom filters, etc. are
useful sometimes but 90% of the time it's a very small handful of techniques
you're using.

