You are not logged in. Please login at to post your questions!


How to understand/learn algorithms?


I'm very confused. I really don't know where to start from. People are saying "Learn Algorithms", "Practice" and stuff. But, the problem is that I'm new to competitive programming and I don't really understand what algorithms are. What will I practice, then? Is there a faster way to learn? At least, just the basics. The problem is that I have very less time(just 4 days) for a contest(codechef based private contest). Anyway, can you provide relevant information(or, a link to it)?

I don't know if this is important or no: But, the language I want to code in is C++. I'm not basically a novice in it, in fact I know it sufficiently enough. Just the problem is I don't know much about algorithms.

asked 18 Aug '14, 18:50

kartikeyp's gravatar image

accept rate: 0%

Unfortunately you can't learn much about algorithms in just 4 days. The best thing you can do right now is learn about STL. It has many data structures and algorithms already implemented.


answered 18 Aug '14, 18:57

neo1tech9_7's gravatar image

accept rate: 19%

if you want you can have a look here it's brilliant for starting off.It will surely take time to get a grip of it but the rewards are breath-taking :)


answered 18 Aug '14, 20:43

zargus's gravatar image

accept rate: 0%

Okay.. Thanks for the help.

(19 Aug '14, 08:19) kartikeyp2★

First of all don't hurry in becoming good at it. It would be a big mistake. I made the same mistake two years ago, got frustrated and left it. Now i started all over again(bcoz i started missing it & can't be without it), right from basics(DS: LL,Trees,Graph) & will slowly move to DP & Algos.

Try solving easy ones. Try for 2-3 hours, if not then discuss/see tutorial/solutions. Keep practicing easy ones then move to medium levels. Read editorials,try your self then read code of others as much as u can(but after you have given a decent try). Slowly you will start becoming good at it. It may take time but depends on how much involvement is there from your side. And Meditate regularly! Improves focus & intuition, which improves logic/maths.

For inspiration, there are many but best i know is :


answered 19 Aug '14, 10:16

vickywiz's gravatar image

accept rate: 0%

Quite comprehensive. Thanks for the help.

(19 Aug '14, 10:44) kartikeyp2★

try this website i hope this will be helpfull....


answered 19 Aug '14, 10:17

grvana's gravatar image

accept rate: 5%

This one was really helpful! Thanks.

(19 Aug '14, 20:18) kartikeyp2★

Competitive programming is like a sport. There is never a shortcut. There is nothing of the sorts where u have a wishlist of algorithms that u can master in merely 3-4 days. In so less time u can just practice random stuff or any specific weak area that you might have. Apart from that i'm sorry to say there is nothing much to help you out. It doesn't matter even if you are an expert in C or C++. At the end of the day what matters is the logic that you come up with.


answered 18 Aug '14, 20:00

edorado93's gravatar image

accept rate: 50%

Thanks. I'll try learning whatever I can, and just focus on getting a feel of the competition.

(19 Aug '14, 20:20) kartikeyp2★

Try this book for algorithm -
Introduction of Algorithm - Thomas H. Cormen .


answered 19 Aug '14, 16:25

rajat_dtc's gravatar image

accept rate: 6%

Its hard to read a book at this stage. Anyway, Thanks for Answering.

(19 Aug '14, 20:18) kartikeyp2★

bt still in case you want to follow this book you can refer to this blog

(19 Aug '14, 22:34) grvana1★

and one most important thing as u have time constraint jst be active on codechef you will learn lot of things which one can not do in a month..... best people are here to help and a lot of study material is available.... im jst following it and yes im lovin it.... happy coding... ...grv...


answered 19 Aug '14, 22:38

grvana's gravatar image

accept rate: 5%


Okay, I'll be active. Thanks, and Same to You. :)

(20 Aug '14, 19:14) kartikeyp2★
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 18 Aug '14, 18:50

question was seen: 5,183 times

last updated: 20 Aug '14, 19:14