Advice for Beginners

First Things First

I commend you for wanting to learn more, be it as preparation for programming contests or for some other reason. Now, I’d like to start by clarifying something. Let’s speak frankly for a moment… from my experience with some of the people who have approached me in the past looking for help, I can tell that sometimes novices are under the impression that there must exist some type of “shortcut” or “magical” process that can turn you into an expert programmer and problem solver overnight. Therefore, and understandably so, they become interested in just finding this shortcut which will automatically make every problem seem easy.

Maybe some experienced programmers agree with that point of view, and they could give you different advice, but I am decidedly not one of them. The more I learn and practise, the more convinced I am of the fact that there are simply no shortcuts, no magic wands that can turn you into an expert on–the–fly. Moreover, there is no one who can do the work for you, even if they wanted to. Your progress depends exclusively on one person, and that is yourself.

This means I don’t really have any interesting advice to give you on how to get better in a particular topic or improve your problem solving skills in general. I can simply give you a generic “learn the theory and practice with problems”. That being said, I do have a few tips that may help…

Books

For learning the theory, I think the best is to refer to books. A couple of good ones oriented to programming competitions are:

And a few more academic ones, where the theory is more rigorously mathematical:

If you have the possibility to buy any of these books, I think that would be a great investment. Try looking them up in a public library first to get a feel for the style of writing of each author, you may find some easier to understand than others. Personally, I really like the style of Donald Knuth, who is the author of the classic series of books The Art of Computer Programming and co–author of Concrete Mathematics.

Practice, Practice, Practice

Other than books, my main recommendation is to just go ahead and try to solve problems, even if you find them beyond your current skill level (I should say, especially if you find them beyond your current level). Investing your time on a problem, even if you can’t solve it for a while, is time well spent, because what you are doing is expanding the limits of your mind little by little, and there will come a time when you can go back to the problem and find it easier to solve, and your solutions in general will become more elegant with time.

Also, you can always ask for help if you find it necessary. Many other programmers before you have walked the path you’re in, and I’m sure many will give you a hand if possible.

Web References

Try also looking for reference material on the web. Find a topic you find interesting and just search about it. In this regard, sometimes I get asked to reference tutorials or articles to learn a certain topic. I can understand the appeal of asking someone else to tell you what to read; however, there’s a couple of reasons why I usually can’t satisfy this type of request.

First, in most cases, whenever I learn a new topic, I do it through many different means (books, articles, videos, conversations with friends, etc.) and it’s a little hard to pinpoint the exact moment when I felt I finally learned what I wanted, or the exact elements that were the most useful in my learning process. Sometimes the topic I get asked about is something I learned a long time ago, and I can’t even remember the exact references I used.

Secondly, I hold the belief that different people have different ways to learn. This means that even if I had a group of resources that I felt were perfectly suitable for me to learn a subject, I just can’t guarantee that you or anybody else will feel the same way about them. I think it’s a much better idea to spend the time doing your own research, which is more likely lead you to the best resources you could find according to your own tastes and needs.

Keep in mind that sometimes you will come across a really good resource (an article on the web, for example), but it may look confusing to you at first, simply because you need to learn some more basic things first. Take your time, and try to progress gradually and steadily at your own pace. Try to avoid skipping things, even if they look too basic for you; sometimes learning those “basic” things are the key to successfully comprehending more advanced topics.

Final Tips

Here’s a few extra tips for solving algorithm problems:

  • If you can’t recognise the type of problems you come across with, there are many useful resources that can help you. LightOJ, for example, has its archive categorised so it’s easy to find out the relevant topics that can help you solve each problem. The following websites also have useful information about problems from the UVa archives:
  • Use the forum systems from the online judges! You can find many useful information from previous discussions, and you can also ask your own questions, which is an excellent way to quickly speed up your progress.
  • An excellent tool to help you determine which problems to solve next is Felix Halim’s uHunt for the UVa OJ. If you haven’t used it yet, give it a try!
  • Try to solve the problems by yourself as much as possible. The point of all of this is to learn, so you can apply your knowledge when the right time comes, be it in a competition, or when solving a real-life problem. Be patient and don’t be afraid to put on all the effort you deem necessary to solve a problem; it will be worth it.
  • Don’t forget that solving algorithm problems is primarily a really fun activity. Don’t suffer the problems… enjoy them :).

5 comments:

  1. Hi there! Just came across your blog and what a nice surprise to find Igor tools in your recommendation list :).

    What do you think about the book Algorithms (Sedgewick, Wayne) ?

    Thanks in advance

    ReplyDelete
  2. Thanks for the article! I found that uHunt is basically what I was looking for.

    HackerRank seems pretty nice in my experience. But it is perhaps better for building a portfolio of accomplishments and interfacing with prospective employers.

    ReplyDelete
  3. Really, its a good article .

    ReplyDelete