Better way to learn algorithms

Hello Guys,

I’m new to competitive programming. I know this has been asked many times and i have been through many of the blogs. But I just wanted to explain my case. I know basic data structures like Linked Lists, Stacks, Queues and Trees. But i don’t know any algorithms. Many people suggested to watch some videos on BFS, DFS and graphs or maybe learn a book but i get too bored doing them. I would rather solve some question on BFS, if i didn’t get it, check the solution and then learn about it. So am i doing it the right way? Can i learn important algorithms as i go on practicing or should i take some kind of course and then come back later for practice?

Also please suggest all the important topic tags or questions(like bfs,minimum spanning tree,shortest path etc.) so i could learn algorithms by practice,which will help me in interview preparations.
Like a link to a question which teaches me basics about BFS.
link to a question which teaches me about Merge sort etc.

Ps. I could only solve 2 questions in all the long challenges i have participated.
Thank You!
Peace! :slight_smile:

Solve two problem in this long challenge? Then you should solve basic implementation,number theory/math,greedy type problem first. You need to develop your observation, then focus on algo :slightly_smiling_face:

1 Like

I practice this way. Go to codeforces, select a rating range for questions. Sort them by most solved. Start solving. Remember you need to increase rating once you are starting to get some approach rather than initial phase where you just looked at problem and had no idea of what to even don’t know.

Then for stuck questions read editorial. You see a word there you have no idea about? Learn it. New DS or algo, solve a few questions from tutorial.

But last but most important is to have fun. Competitive takes a lot of effort to improve. Having fun makes it tolerable.


Nice Approach! would definitely do this. Thanks. Peace! :slight_smile: