This is in continuation to my previous question where I asked is it necessary to learn algorithms and data structures. I feel yes it is.

Now I work in an environment where I won't ever get the chance to learn it by experimenting or practically or in any assignment. What is the right approach like the right books, right kind of problems, right kind of resources that I can go through to give six months or a year or two to learn algorithms and data structures? And also mold my mind in a way that it can relate problems to data structures and algorithms.

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
If this question can be reworded to fit the rules in the help center, please edit the question.

@lukas: Still haven't finished it though, there's quite a few maths in there that I am not that comfortable with. It did much more to my knowledge of algorithms, data structures and their analysis, that any other single source though :)
–
Matthieu M.Jan 2 '11 at 18:28

You may also try my project, which describes popular algorithms and data structures more straightforwardly than wikipedia and contains souce codes almost for every article (structure, approach, algorithm)... en.algoritmy.net
–
malejpavoukNov 29 '11 at 21:38

10 Answers
10

Read everything about algorithm and design you can possible find. There are phenomenal books out there. The Sedgewick algorithm books are good. The Algorithm Design Manual by Skiena is good as well. Together these books follow me on every bookshelf at every job I go to, along with The Mythical Man-Month.

Then ask.

Talk to people you respect. Ask them what decision points they had and why they made the decisions they did. The good ones will always be able to tell you "I chose to do X because it's better than A, B in these ways. I could have gone with C, but I felt this was a better choice because of this".

Next, do.

Build stuff. Build stuff that you'll never use. Build stuff that you'll never need. Go write a program that solves a Sudoku puzzle. Now go do it again. And again. Build it 5 completely different ways. Build a program that generates Sudoku puzzles and feed it into the solvers. Find which solver is fastest. And then...

Find out why.

The "what" is almost never important. I mean, yeah, it is critical to finishing the project at hand, but at the end if you know the "what" without knowing the "why", then you might as well never done it in the first place. You got a bullet point on your resume. Go get a cookie and congratulate yourself. The "why" is so much more important than the "what".

And for the record Sudoku was an example. I spent a lot of free time going through that exercise with a ton of the logic puzzles on Kongregate and learned a lot on the way.

In the age of an ever-increasing drive to information on the internet, it's important to add: read books (not exclusively, of course). A consistent, coherent introduction into a matter that's longer than 2-3 ad-separated HTML pages is A Good Thing™! Don't underestimate it (and yes, of course ebooks are fine).
–
Joachim SauerApr 8 '13 at 16:29

1

Agreed. Consistency is key. It's hard to grok data structures when you're getting one or two from a dozen different sources. Books also tend to have better diagrams (some blogs/online sources do, but as a generalization books are better). The Sedgewick books have a particularly good mix of diagrams, simple to follow code and description.
–
HounshellApr 8 '13 at 20:46

Algorithms

I took magic lessons in a group setting when I was twelve years old. The magician's name was Joe Carota. He did a trick one time and I blurted out, "How did you do that?" He said something that day that has stuck with me ever since.

Joe's response, "Michael, if you really want to know how that trick is done you must figure out how you would do it yourself."

Well of course that's not what I wanted to hear but it did get my mind focused on problem solving. This was problem solving from my perspective. If my first attempt at solving the problem took seventeen steps and was really klunky, the good news was I solved the problem.

Then by looking at the solution I had developed and looking for ways to refine that solution I would learn how to streamline the end result. Later on in my computer programming life I found out that this process was called "Stepwise Refinement". I think today they call it refactoring.

See if you can take an online course, or get tutored. Failing that, this popped up in a quick google search. I just took a class on it this past spring (first ever, I moved from EE to software) and it wasn't too hard to pick up if you understand pointers well.

I am a graduate from computer science and it has been six years since then. I never concentrated on these subject there it was web, usability, client server, that attracted me and i am working on these fields only but now i feel like i should learn them as well. What are your thoughts.
–
sushil bharwaniNov 12 '10 at 17:10

Go back and take a refresher course :-)
–
Martijn VerburgNov 12 '10 at 18:27

Start working on solving classical problems on for example sphere online, the site might not look that fancy but boy, these are classical programming problems that require many of the important data structures and algorithms in use today.

Solutions can be submitted in a variety of programming languages from C/C++ to JavaScript, Lisp, Smalltalk, assembler + some 40 more. So you can focus entirely on solving the problem with whatever programming language you feel comfortable with.

This is by far my favorite resource. I used it in my undergraduate computer science algorithms course and ended up buying the book 4 years later to read on my own to prepare for my M.S. Comp Sci courses. It isn't an easy read by any means but if you work to understand the some of the math/proofs presented and then implement the pseudo-code in your favorite language(s), it is well worth the somewhat hefty price-tag. The Algorithm Design Manual others have mentioned is also a great resource for learning problem identification but I found CLRS to be better for pure detail.