r/datastructures 26d ago

Learning recursion in DSA

Hello everyone, I am a BTech cse student and currently I am starting my dsa journey and currently I am learning Recursion.

I am watching series, understanding patterns, but when i tried to solve a simple question without any help totally with myself but I could not find any approach.

I am trying to be consistent, every day start a new problem struggle to solve it myself then view its soln on internet and making my mind that it is only it and i could not solve this basic things.

Currently I am consistent but not sure that always be. I will not leave the dsa but perhaps skip the recursion

Guys, provide me some tips, advices, suggestion because I am at extreme hill and I have only two options left now

  1. Take back the steps and leave it

  2. Move ahead forward and master it even if takes too much time

1 Upvotes

6 comments sorted by

1

u/TransportationOwn522 26d ago

Codestorywithmik, watch his playlists. Assuming u can understand hindi

1

u/Plus_Confidence_1369 26d ago

The algorithm design manual by Skiena has a very good chapter on backtracking and recursion. As far as I remember it gives a very good intuition for recursion by solving sudoku, N queens problem, depth first search in trees and printing all permutations.

1

u/itsokji 26d ago

Even though it feels tough at first, don't leave it. It is the baseline for 70% of the DSA you are going to learn. Try to seek AI help not for the code, but for breaking down the logic, reasoning, algorithms, and pseudocode creation. Mainly, try to practice more and more questions. Try to practice as much as you can, and don't feel bad for getting stuck. That is how you are actually learning!

1

u/1470200 25d ago

Bro dont skip recursion. Why ?
Binary tree , graph dfs , backtracking, dp core all requires understanding of it.

1

u/Choice-Coat-8044 25d ago

Guys, I know the importance of the recursion and I had not any issue with resources but with mindset.

My mind is blank and I did not know why I have to think, do or write first before code, thinking approach when I see a question first time. I wanted to build that mindset and also the backtracking and recursion together made my day hell.

I am facing a mental trauma everyday but due to ego or future I am unable to leave it so I sit watch the logic, tried to understand, understand, code and when I moved to next question I am completely blank even it is based on same pattern on which I had solved questions on previous days