The Comprehensive Guide on How to Get Started With Data Structures & Algorithms

Rasheed K Mozaffar - Aug 2 '23 - - Dev Community

Hello everyone ๐Ÿ‘‹๐Ÿป
I want to talk you through a very very very important concept, and that is Data Structures and Algorithms (DSA), not teaching you the concept, but giving you key points to learning DSA the correct and easy way.

Now DSA is a really massive topic, and we can spend countless hours talking about it, and breaking into it is really daunting, it's just too overwhelming, but not with the right techniques at hand, and guess what? I'm going to show you exactly those techniques you'll need, to grow your DSA skills, and I got you the best resource that will boost your learning journey, but before we get into the decent parts, you must understand something, regardless of how useful the ideas I'm going to share are, there'll still be a lot of difficulty during your journey, but with the core technique, that is consistency, you'll dig your way through the harsh swirling roads of DSA.

โš ๏ธ: Check out the end of the post for the learning resources, the reason I've put them in the end is that I want you to take the strategies from the post, and then apply them on the resources, instead of just jumping up right away.

Here's a brief list of titles on what we'll be discussing in this post

1: Why learn Data Structures and Algorithms?
2: Do the tips only apply for specific programming languages?
3: The essence

1: Why learn Data Structures and Algorithms? ๐Ÿค”

The concept of DSA applies everywhere, from the built-in methods you use, to the collections i.e arrays, lists and such things, DSA is almost ubiquitous, and if you're learning how to code, then you're probably learning to get a job, and most jobs have technical interview rounds in which you're expected to have a solid DSA knowledge. Additionally, thorough understanding of DSA makes your code more efficient and every line becomes more effective, and that's a skill worth investing the time in.

2: Do the tips only apply for specific programming languages? ๐Ÿ‘€

Are we talking specifics here? Like do these ideas apply for C# developers and not Python developers, or Swift? The answer is, no. ๐Ÿฅธ
These tips work for everything and everyone, but to get the best out of them, and push your learning process, you need to at least have a solid hold of your language of favor. These tips aren't going to teach you how to pick a problem and solve it, or how to learn that data structure, what you're getting instead is a way of learning, that not only applies for DSA, but for other endeavors as well, you'll learn a way of acting, a sequence of actions if performed consistently, will yield out the best possible outcomes, with that said, let's begin! ๐Ÿš€

Tip 1: Create a digital notebook to keep notes ๐Ÿ“

There're amazing apps out there, that you could harness for your own advantage, my personal favorite and the one I recommend is Notion, you can use it on any device, and once you get used to it, you'll love using it more and more.

Now tip 2 is based on tip 1, so make sure you get the first tip done before moving on.

Tip 2: Document your learnings on your notebook ๐Ÿ“’

Ok this tip isn't just about writing and jotting notes down on Notion or the app of choice, it's rather about getting the most valuable information, and writing it in a way that's easy to follow along, and sufficient enough to remind you of the essential ideas of the concept, take the following picture for example

Algorithm notes

Now as you can see from the picture, I created a simple page describing an algorithm known as Binary Search, just some simple notes and a code example, and that's enough info to refresh my memory on the concept in a short time period.

Tip 3: Follow a learning pattern ๐Ÿ›ฃ๏ธ

Some people jump straight into solving DSA questions, thinking that they'd learn the necessary things along the way, and that's wrong, don't do that, follow this pattern instead.

1 -> Pick an algorithm
2 -> Study and document the algorithm

Algorithms documentation
3 -> Start solving questions related to the algorithm

In the course you'll find in the bottom, you'll see that there're videos curated for a single algorithm, the video first explains the theory, how to implement the algorithm, and then it'll solve a bunch of questions on it, and that's a truly practical method of learning DSA, don't attempt going all out, with no algorithmic knowledge up your sleeve.

Learn the algorithm -> Document it -> Solve questions

Tip 4: Don't just follow along, write things down too โœ๏ธ

Use a pen and paper, scratch and visualize how the algorithms are working, don't just sit there watching the videos passing time, get your hands and brain fully involved, learn actively by looking and dissecting the process yourself, instead of sitting and watching the tutor doing everything.

Tip 5: Use LeetCode, but correctly ๐Ÿ’ป

If you've tried LeetCode before, as a beginner, then you already know how challenging it is to get started there, even solving the easy problems feels so difficult and out of reach, well, that boils down to two things:

1: You don't have enough algorithmic knowledge YET
2: You're not using the platform efficiently

You may see a lot of questions labeled as Easy, but in reality, they turn out to be quite difficult and sometimes impossible, well that's because they're labeled as "Easy" according to the system, now if you want to get the real EASY questions, you must make use of the stats, like this:

Filtering on LeetCode

First go to the problems tab, pick a tag, like Arrays for instance, and then select Easy, after that, click on the word Acceptance, that will sort the problems in an acceptance rate descending order, therefore you will get the problems with the highest rate at the top, those are often times the very easy problems.

Tip 6: Practice questions on daily basis ๐Ÿ—“๏ธ

Regardless of how easy and simple the question, build the habit of solving at least one a day, if you do that for a month, you'll have solved 30 questions, and that's pretty good considering the fact that solving only one was initially observed impossible. Over time your skillset will grow, your arsenal will have more algorithms for you to choose from, and that is when you become capable of solving Medium and even Hard questions.

Tip 7: Keep track of every question you solve ๐Ÿงฎ

The final tip is to note down the name of the question, the day on which you solved the question, and lastly a brief note that would give you a hint on how you solved the question so for future reviews, your life would be so much easier, you could do something like the following:

Tracking solved questions

Resources

A full video playlist:
https://youtube.com/playlist?list=PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ

The Github repo for the assignments:
https://github.com/kunal-kushwaha/DSA-Bootcamp-Java/blob/main/assignments/06-searching.md

The course and the repo are for the same thing, the repo provides more questions to solve, for each and every concept, plus you can use the repo as a roadmap for learning DSA as everything is well documented.
You might say that the course teaches Java, that's true, but there're loads of videos on many different algorithms like Linear search, Binary Search, Bubble sort etc...

I promise you if you keep a consistent habit, follow along, and practice daily, things will improve drastically, but give it time and results are guaranteed.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .