Hi everyone. Whenever i learn a new algorithm/technique it stays with me for about an week, after that if i dont solve problems on that technique or algorithm i usually forget about it in future and have to relearn it again. How can i not forget it and retain it forever. Pls help if someone knows how to tackle this
Just solve problems or draw the algorithm's/technique's pattern
Here is my take. You should review them for a bit until it's second nature for you. You can try solving lots of problems on that algorithm/technique for sometime until they're as easy to implement as a for loop. Another approach is to solve the same problem with new ideas/algorithms/techniques multiple times, maybe using a spaced repetition algorithm to schedule that.
Hope that helps!
i aggree with your first approach i would advise solving more problems until you can easily indentify a problem that use this algorithm the number of problems you may need varies depending on the complexity of the algorithm
anki
One more tip:
Do not copy paste code, implement from scratch every time. That way eventually the new technique (DSU, Djikstra, etc) will stick and/or you will make some subtle mistakes until you really understand exactly why each line is the way it is.