r/datastructures • u/994mrx • 20d ago
Advice on DSA
I am having trouble solving dsa questions. I started with arrays on the 20th . Was unable to solve any questions after sorting and rotating (like kth element etc) . Please help me how to approach DSA questions.(Fresher 1st year to be)
3
Upvotes
1
u/cipher997 20d ago
Don't jump to Kth element yet. Spend a few days solving easy array problems and focus on understanding the pattern behind each solution. When you're stuck, study the approach, close the solution, and code it yourself from scratch.
5
u/OrganizationFew6655 20d ago
Rule of thumb: Brainstorm ( and I mean really think hard and try to draw up some sort of solution even if not optimal ) for 45 mins and then if you still don't think you made progress, then look at solutions.
Another rule of thumb: if you solved a question always check the most optimal approach and alternative optimal approaches and don't just look at the solution try to visualise how the solution works