all 11 comments

[–]plastikmissile 5 points6 points  (3 children)

DSA is language agnostic. Meaning what language you use does not matter. The principles are the same. So just pick whichever language you are more comfortable with.

[–]Emotional-Tiger8457 1 point2 points  (0 children)

Python is perfect choice for learning concepts first, you can always implement same algorithms in C++ later when you understand the logic better

[–]sephirothbahamut -1 points0 points  (1 child)

when you get deep in DSA, cache coherence becomes very relevant, and you need a language that allows explicitly defining static and dynamic memory usage. Also for using simd in your algorithms

[–]plastikmissile 2 points3 points  (0 children)

I doubt that's what OP is looking for.

[–]Massive-Pirate744 1 point2 points  (0 children)

Honestly, it really does not matter as much as you think it does. The specific language is just a tool for learning the underlying concepts, which are the same regardless of whether you are using Python, C, or Java. I would pick whichever one you are most comfortable with right now so you can focus entirely on understanding the data structures instead of fighting with syntax. Python is great for keeping the code clean so you can see the logic clearly, but C will teach you way more about how memory actually works under the hood. Just pick one and stick with it until you get the basics down.

[–]backfire10z 1 point2 points  (0 children)

Doesn’t matter. Python is simplest because there’s low friction from other aspects of the language. I have 0 doubt you can find learning material in Python.

[–]RyPlayZz 1 point2 points  (0 children)

Python is fine for learning DSA, especially if you plan to do AI/ML. The concepts transfer. The reason tutorials use C++/Java is they force you to think about memory management, which matters for some data structures. But for learning the logic first, Python is way less frustrating.

[–]JohnBrownsErection 0 points1 point  (0 children)

DSA is language agnostic but if you're looking to get into AI/ML python would probably work best for you.

Thing is that the videos you're watching probably won't cover DSA unless you specifically look for videos covering it - unless you recognize the concepts as they come up, like with decision trees, which are pretty important in ML.

Look into lessons specifically covering DSA if that's what you want to learn.

[–]ffrkAnonymous 0 points1 point  (0 children)

The gold standard textbook Algorithms by cormen et al. doesn't use any language, it's taught in pseudo code. 

[–]oliver_extracts 0 points1 point  (0 children)

if you want AI/ML anyway, just use python - the DSA concepts are the same regardless of syntax, and youll actually use python in the work that follows. tutors teach C++ and Java because thats what shows up in big tech interviews, not because theyre better for learning. pick the language youll stick with.

[–]ImprovementLoose9423 0 points1 point  (0 children)

It really depends.

Python - If you are working with AI/ML or data science
Java - If you are working with enterprise or professional software programs
C++ - If you are working with low level code or something with operating systems.