Hello everyone,
I’m curious about how other people approach learning a new algorithm or data structure in competitive programming, especially when it comes to actually retaining it and using it reliably under contest pressure.
When you pick up something new, I’d love to know:
- How do you study it so it sticks? Do you read editorials first, trace examples by hand, implement it from scratch without looking at code, or just spam problems until the pattern clicks?
- How long does it usually take you to feel master it? Like, from first seeing the idea to being able to spot when to apply it and code it cleanly without silly bugs that a few days, a couple of weeks, or something you revisit over months?
- One at a time or multiple at once? Do you stick to one topic until you feel solid before moving on, or do you juggle a few topics in general problem solving so you don't get burned out or overfit to a single tag?
I feel like everyone has a pretty different workflow here, and hearing what actually works for you (and what doesn't) would be super helpful. Thanks in advance!









I personally think that the best way to improve is to learn until it makes sense for you. So that you can easily connect the dots and come up with a solution (of course it is up to your skills). That's what i prefer and do these days.
Thanks for sharing your perspective. To get to that point where it truly makes sense to you, do you usually try to prove why the algorithm works on your own, or do you rely more on tracing examples and intuition?
Yeah, you must learn in a way that you can teach that topic (e.g. data structures or algorithms) to other people with ease. But I guess you will develop your own approach that is best for you in your journey, just like I did.
the description at the start of this blog is literally me every time I learn a new thing, might help: https://codeforces.me/blog/entry/143282
you need time, be patient... the moments you start feeling pain in your head is the exact moment you are getting better :)
good luck!!
Wouldn’t you want to learn about the topic and what it actually does before solving 10 problems with it?
I would start facing the first problem before learning to at least see challange.
I remember many years ago when I was solving problems on SPOJ and with a friend we discovered sieve and optimisation like start form the square, and how to effectively do prime factorisation..
So, yes, I would put my ability on to test first, that makes learning make sense..
Depends if you have to learn how the algorithm works or just what it does. For OI you have to understand how to implement it but for CF you lowk just black box it, copy a template and understand what its uses are eg segment tree can do prefix sum but slower with online queries. If you have to understand how it works eg to implement (or if you want to modify mid round like I think I did for a max seg tree) then probably first understand what problem it solves then look up an implementation and just walk through it either with a guide or chat and understand each component. Or use usaco guide my beloved