Hacker News new | past | comments | ask | show | jobs | submit login
How can I learn algorithm from scratch
14 points by ankit1911 on Jan 27, 2015 | hide | past | favorite | 8 comments
I had started with C programming on UNIX system about 3 years ago. Currently, I am comfortable with system & network programming. However, the biggest problem I face while coding is my lack of knowledge in the area of algorithm. A few weeks back someone suggested me a book named CLRS, however, even this introduction book is getting heavy now. I am very poor at mathematics. There are tons of experienced folks out here, so I would be very grateful if you guys can let me know how I should start on my way to be good at algorithms. Thanks.



CLRS is quite 'academic' and requires good understanding of mathematics. It's a great book, but not a good one for beginners, imo. It will be difficult as self study for first timers. You can start with Datastructures and Algorithm Analysis in C by M. A. Weiss[0]. One more alternative is The Algorithm Design Manual by S. Skiena[1]. It's also good and focuses more on algorithm, implementation (as opposed to math-y stuff of CLRS). If I were you, I would get both the books and read alternatively. Don't miss out on exercises, they are very important.

I also suggest you to join this Coursera course, Algorithms: Design and Analysis by Tim Roughgarden[2]. Currently the course is open, so you can sign up for classes. The course is offered in two parts[3], complete both of them.

Once you are comfortable with basic concepts start solving questions/puzzles online on sites like SPOJ[4], UVa[5], (YC-funded) HackerRank[6]. You could try TopCoder[7] also, but the questions are bit difficult. Hope this helps.

PS - You should study math, because it is important in Algorithms Analysis. You could try reading required parts of Concrete Mathematics by Knuth[8] or as you come across new concepts, Google and understand them.

[0] - http://www.amazon.com/dp/8177583581

[1] - http://www.amazon.com/dp/1848000693

[2] - https://www.coursera.org/course/algo

[3] - https://www.coursera.org/course/algo2

[4] - http://www.spoj.com

[5] - http://uva.onlinejudge.org

[6] - http://hackerrank.com

[7] - http://www.topcoder.com

[8] - http://www.amazon.com/dp/0201558025


I would also recommend Roughgarden's Coursera classes, however, I would strongly recommend waiting for a live session.

A book I think is informative from a practical perspective is Algorithms in a Nutshell from O'Reilly Press. As always with Amazon I would look for a used copy.


But no need to wait at this moment, as class is live. However I also agree that live session is recommended and actually fun. Some of the Community TAs are really good, which one will miss if attended non-live version of class.


You could check out the following resources:

1. Coursera Algorithms I for formal university-style learning. See https://www.coursera.org/course/algs4partI

2. Algomation.com for visualising algorithms. See http://www.algomation.com/

3. http://bigocheatsheet.com/ for time/space complexities for the most common data structures & algorithms.

4. The book - Cracking the Coding Interview which goes through the questions that top companies like Google, Amazon, Microsoft ask during interviews. For their solutions, see https://github.com/gaylemcd/ctci

Hope that helps in some ways.


+1, I just enrolled on the Coursera algorithms course, I was going to recommend that one.

My only complaint is that they removed the videos from past sessions (I did find them elsewhere on the web).


The great thing about being very poor at mathematics is that it is easy to improve and to improve quickly...of course this requires accepting that being poor is an improvement over being very poor and that it will require much more effort to go from poor to mediocre.

The great thing about self-directed learning is that there is so much time over which to acquire new knowledge in the area. And in the age of the internet there are vast resources available on any computing topic.

The best resource for learning algorithms is Wikipedia. It doesn't stand alone and a lot of the typical algorithm article will go over most people's head but the more you learn the more of an article will make sense each time you come back to it.

Finally, there are only a few people who are objectively good at designing algorithms - Tarjan, Hoare, Dijkstra for example. Most of what is professionally good is pattern matching existing algorithms to new situations. That's the art that Knuth has spent sixty years describing.


The best way that I learned algorithms was I looked at many different books about them. Here are some of the ones I used and you can contact me if you want any of them I have all the pdfs, I also want to say that I dont know if they are the best but they helped me to understand Algorithms and I really love them now, it is so interesting.

Intro to Algorithms, it was pretty tough at times but I really liked it. The Algorithm design manual. Algorithms in a nutshell.

I also was taking a course at Temple which helped but I really liked reading about them, than I thought a lot about the algorithm. I also have a lot of Data Structures books to go along with the Algorithm books too, let me know and they are all yours.


MIT has some great youtube videos on Algos. and data structures - https://www.youtube.com/channel/UCEBb1b_L6zDS3xTUrIALZOw




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: