views:

587

answers:

8

I've been a software developer for the past 4 and a half years, mostly working on "enterprise" web applications using Java and JEE (I even got myself certified as a Java programmer a few years ago); I know OO theory really well and I can even apply some of the most well known design patterns effectively; I love coding and learning new frameworks and languages and figuring out where I can apply them in my job. The problem arises when someone asks me algorithm related problems and questions like those on the career cup site, specially big O and recursive stuff or applied mathematics. I freeze. I've tried reading through the Cormen book on algorithms but no matter how hard I try it's very hard for me to get this stuff. I feel like an idiot and I wonder if I should switch careers, but I don't want to.

I love programming and I feel really bad about this; I feel stupid and dumb and questioning myself at this point in my life makes me feel uncertain and insecure about myself. I really need help figuring out how I can solve this problem. Are there any books or resources that could help me?.

+6  A: 

Although Cormen's book is considered to be one of the best in algorithms, I'd also suggest you to read Sedgewick's books. Since you are Java programmer, you might find these books easy to read.

By Robert Sedgewick

Sorantis
Thanks for the suggestions I'll have a look at those.
rsmarin
+3  A: 

While I'm not sure how helpful it will be if you struggle with this sort of thing, the authoritative text on the subject is probably The Art of Computer Programming. Be warned it's a monster of a text and it will have no qualms about eating you.

docgnome
That may be the best book on the subject, but probably way too big to master from a beginner point of view.
Liran Orevi
You should be prepared for this book. Or else it may make you hate the algorithms.
Sorantis
+5  A: 

I can empathise. However, I'd say that in the field of web development there isn't any paramount need to be able to come-up with complex, mathematical algorithms in every-day coding (at least, in the stuff I've developed). There are far more important qualities than being "good at maths" for a programmer to have - and it seems you have these, so why worry? Programming covers a huge ground and the guy that is good at algorithms may be poor at database design - whether this matters or not is very much dependent on what kind of programming you do.

So, I wouldn't beat yourself up about it - very few people have all bases covered. Just be glad you are good at the things that matter most to the kind of work you do. And, if there are occasional cases where you need to able to come-up with complex algorithms then do the smart thing and Google it or ask here - there's no shame in asking about the things you don't know about. Being smart isn't just about being able to remember lots of complex theories it's also about knowing how to be pragmatic - and if that means using someone else's code, routines or idea to get the job done, then nothing wrong with that.

Dan Diplo
+4  A: 

There is no reason to feel bad, most of programming is not about algorithms. roughly speaking you can have average knowledge about this in a few weeks. To reach this level there are some definitions to remember, and some very important data structures and basic algorithms and that's it.

What you need right now is a crush curse in algorithms. I suggest finding a mentor. Being an experienced programmer, several hours with a friend who loves to explain , will get you started.

Cormen's book is very hard to read by yourself. but it has the advantage of providing proves, which is a big concept in this field, and also it makes a a very good reference book.

The thing with Cormen's book in my opinion is not to read it from start to end, but to know what to read. so maybe a friend can guide you through this as well. reading it with a friend will be a totally different exprience.

There are other books, but you'll want some book with proves, as you are already keen from the practical point of things.

To sum it up: find a friend who knows about this subject to private tutor you. on any case, this shouldn't take more than a few weeks/months depending on the wanted level.

Liran Orevi
+1, I'll just add my 5 cents.. You can ask your questions here. I believe you will find the answers. A lot of folks here will be happy to explain and also test themselves. So, chin up!
Sorantis
+1  A: 

Quote from Cormen's book

The example above shows that algorithms, like computer hardware, are a technology.

So as you can see, algorithms are viewed as technology, which of course is widely used but still.

Sorantis
I don't think this view, while it is probably accurate, is widely-spread. Many programmer tend to put a high value on data structures and algorithms knowledge as if it were a measure of programming ability. While there is probably a correlation, it's a poor measurement, but one that still often used in interviews.
Imagist
Yes, in programming algorithms measure your ability to think and solve a problem.
Sorantis
+9  A: 

I think it is great that you can identify a professional weakness and you are serious about improving. In my opinion, this separates you from the crowd of developers. Continue to be critical of yourself, but don't go overboard. Sure, algorithms are fundamental to computer science but, as you state, you can be a successful developer without getting your head around them. I could be wrong, but I've recognized that most developers excel in certain areas and yet struggle in others. This is common and I whole-heartedly do not think you should be questioning your career simply because of this one little shortcoming. If you are insecure about algorithms and improving your skill set is important to you, keep plugging away. On a personal note, I had little formal knowledge of design patterns until recently. I forced myself through books and online tutorials, but, for me, I didn't really start learning the material until I put patterns to practice. I suggest the same for you. Get familiar with the basics, learn where you might apply a given algorithm and code away. If you can find a fellow developer which really knows their stuff, and can critique your work, all the better. Best of luck. Don't give up.

Ben Griswold
+2  A: 

Like everyone else said, don't give up because you haven't wrapped your head around analysis of algorithms yet. It really isn't as important in practice as a lot of people think that it is. This should be pretty evident to you since you've been doing pretty well without it.

I would highly recommend reading the first volume of The Art of Computer Programming. It's entitled "Fundamental Algorithms" and contains what I consider to be the best introduction to algorithms and their analysis. If you are referring to Introduction to Algorithms when you say "the Cormen book", then you will probably find Knuth more readable. I know that I did.

If you do want to dive in and learn how to analyze algorithms for complexity bounds and what not, then you should probably brush up on infinite sequences, recurrence relations, and limits. You might be able to learn everything that you need from the web and the first volume of TAoCP. If not, consider taking a college level calculus course if you haven't. You don't need a minor in math, but a good solid understanding of series and limits will go a long way towards having a good sense of algorithmic complexity.

Just don't stress out over it. Keep working at it and you'll be fine. Just asking the question here is a great start ;)

D.Shawley
+2  A: 

Boy, you know, the last time i actually had to mess with algorithms was in university :) I haven't had the chance to apply any of them in real-world environments. I wouldn't feel bad about it. However, i would strongly suggest that you familiarize yourself with the concepts of the Big O notation, calculating complexities and getting along with the basics of a few common data structures. Even though it may look as extraneous information that you'd probably never need as a web developer, you're technically obligated to know this stuff as a programmer. I know a lot of companies in the area are expecting their developers to know this stuff. Any good programmer will tell you that you ought to be able to approximate complexity of a few lines of code. It's just essential to your profession.

Sergey