How to learn and memorize algorithms efficiently? I always feel that I have read some algorithms several times but still haven't memorized them. Many algorithms I learned a year ago, I can't write them right now.
Can someone provide an effective method to learn and memorize algorithms? Thanks.









I think if you go a whole year without implementing some algorithm, you're bound to forget it within that time.
I would say if you at least semi understand how the algorithm works, even if you forget it after some time you can come up with it by yourself just by logic.
Roses are red
Violets are blue
The audacity of advising 2000s
While Expert remains a dream for you!
( Edit : forgot to mention that it was a satire regarding Ratism, no personal attack!)
I mean. He's right. Although it depends on what algos. I don't think you'll ever forget things like most useful algos for div2 A through E. On the other hand stuff like LLRBT deletion, DSU a(n) amortized time complexity proof (I wrote one #ad), crazy convex hull and segtree beats stuff, probably.
you don't need the dsu a(n) proof you just do dsu and way "for al intents and purposes this is O(1)
If we're comparing ourselves by rating for absolutely no reason, then well... you're a newbie
To say that a specialist is always strictly worse than a 2000 in every aspect is pretty absurd.
I never dream.
In terms of learning/memorizing, it can help to check if you actually understand the algorithm by writing your own version/writing it in a way that you understand every step. Dissect the algorithm and probe for gaps in your understanding.
Generally, the most effective method of remembering these algorithms for extended periods of time is to periodically use them and refresh yourself on the underlying mechanics; as with most forms of knowledge, if you don't use it you lose it. There aren't really any shortcuts.
Thanks guys, I perhaps need to find some trick on memorizing things. :)
In fact, every algo has it's tricks. When preparing for comps, I need to cover every algos, and it's tricks too, so I might need a way to remember these tricks when I first met them...
The method I relied upon is to first fully understand how it works, and then using a flash cards application with some problems on cses (that relies on implementing said algso). So when you draw a card, you can implement it, if you can sucessfully, you mark it as okay, if you needed to look back at the article about it, you mark it as wrong.
Sounds nice, I will try it. :>
Thanks!