Hey everyone! I'm a bit lost on the best approach to learning Data Structures and Algorithms (DSA). I'm wondering if I should focus on learning data structures individually (like arrays, strings, and linked lists) first, or if I should tackle algorithms (like sorting, binary search, sliding window techniques) first, or if I should mix both methods together.
When I come across a new topic, should I watch a video to understand how it works before attempting to solve related problems, or should I just dive into solving problems and learn from the solutions I encounter?
I often feel overwhelmed by the variety of roadmaps and DSA resources out there, and I really want to build a solid foundation by understanding patterns rather than just solving random problems. I'm currently following a roadmap, but I'm still confused about the best way to proceed. What strategies have worked for you in mastering DSA? Any advice would be much appreciated!
5 Answers
Honestly, data structures and algorithms are pretty interconnected, so I’d suggest starting with the data structures you mentioned, as most resources will cover the essential algorithms related to each one. It's definitely worth trying to solve problems on your own first, but if you’re stuck for hours, don’t hesitate to peek at the solutions for a nudge in the right direction.
Overthinking the structure of your learning can actually stall your progress. Just dive into the materials and learn as you go. If you hit something you don’t know, jot it down and research it then and there!
Remember that it’s DSA for a reason – they are all interconnected! Even simple operations like inserting or removing an element can be seen as algorithms themselves with their own complexities. Most roadmaps are going to have similar paths: start with basic searching and sorting, move into arrays and linked lists, and proceed to queues, stacks, trees, and so forth. Focus less on just 'solving problems' and more on understanding each data structure. Try implementing them yourself without relying too much on tutorials; draw, diagram, and write out pseudocode to deepen your grasp.
Start with arrays and work your way through concepts like time complexity and Big O notation. YouTube can be a gold mine for this - check out playlists that align with your learning style or even CS50 content. If videos aren’t your thing, grab a coding book and go through coding snippets by hand to learn by doing.
Check out Neetcode! They have a nice pathway that lays out the order in which to tackle topics for DSA learning. It really helps to have a structured approach.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically