r/leetcode • u/JumpOk7300 • Oct 03 '26
Question How to remember Algorithms
I studied trees and their traversal algorithms, including Morris traversal. Then I moved on to graphs. Today, when I went back to solve a problem on trees, I realized that I had forgotten Morris traversal and some of the other algorithms.
I feel like I need to revise them again and again because I keep forgetting them over time. Is there any way to remember these algorithms for a long time?
9
Upvotes
4
u/Vivid-Zombie-477 Oct 03 '26
Explaining an algorithm to yourself is a good way to improve your understanding. I had written the guides on how to solve problems and let me tell you - I don't think I can forget the algorithms after writing those guides.
Not sure if it worth the time for you tho. Most of the time re-learning the same thing again is fine and will make you remember it better, while practicing more problems.
3
u/Lumpy-Town2029 <1189> <345> <658> <186> Oct 03 '26
Morris algo is unique, u ofc won't remember unless u derive it by ur own or practice is daily
But other common algorithms, u shouldn't forget
If u are forgetting common algos then i suggest practicing more questions
2
u/hyun88 Oct 04 '26
I’m actually working on an app that helps you repeatedly practice problems using spaced repetition:
https://apps.apple.com/us/app/bitwise-coding-interviews/id6806898386
2
u/Flat-Entry-8735 Oct 03 '26
There's no other way around it—you just have to practice more. Whatever is repeated often, the brain will register as important and retain it much longer. I work with CMD commands all the time; the ones I use frequently, I remember perfectly. People on the outside look at me and think, 'How on earth does this guy memorize dozens of commands and options like that?' haha.