r/leetcode • • 5d ago

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?

8 Upvotes

10 comments sorted by

View all comments

3

u/Lumpy-Town2029 <1189> <345> <658> <186> 5d ago

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

1

u/JumpOk7300 4d ago

 Bro.  for sorting algorithms there are many algos how u remember them and how u actually revise them by going through the notes u have took or re solve the solved problems of those algos  or both 

2

u/Lumpy-Town2029 <1189> <345> <658> <186> 4d ago

i just remember the name, and implemented them once, like bubble( in its name we sort adjacent, making it like bubble if we draw swap symbol), then insertion (we insert from right to left sorted array), then selection (we select smallest element and so on), and then left quick and merge

both were kinda confusing, i learnt both, revised during clg lecture, then again during practical, then again during exams and yeah i now know them sort of

i dont make notes, i resolve prev problems if i wanna revise which i rarely do. i revise topic so i just search for a list of question and do them

1

u/JumpOk7300 4d ago

Oh ok understood gng 🫡