DSA with Python, C++ or Java ?
Posted by goodmaannn@reddit | learnprogramming | View on Reddit | 10 comments
I am genuinely confused right now , which language to choose ? I thought python would be great as it will also help me with AI/ML branches but in YouTube and many other platforms tutors are teaching DSA with C++ or Java , they are not even mentioning Python. And I have time (if this helps me to choose any language). Would you please help me with this.
oliver_extracts@reddit
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.
ffrkAnonymous@reddit
The gold standard textbook Algorithms by cormen et al. doesn't use any language, it's taught in pseudo code.
RyPlayZz@reddit
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.
plastikmissile@reddit
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.
sephirothbahamut@reddit
when you get deep in DSA, cache coherence becokes very relevant, and you need a language that allows explicitly defining static and dynamic memory usage.
plastikmissile@reddit
I doubt that's what OP is looking for.
Emotional-Tiger8457@reddit
Python is perfect choice for learning concepts first, you can always implement same algorithms in C++ later when you understand the logic better
backfire10z@reddit
Doesn’t matter. Python is probably just because there’s low friction from other aspects of the language. I have 0 doubt you can find learning material in Python.
JohnBrownsErection@reddit
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.
Look into lessons specifically covering DSA if that's what you want to learn.
Massive-Pirate744@reddit
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.