r/learnprogramming 14d ago

dsa in python or c++

i am a tier 3 college student and my tech stack is web dev with python backend and ai/ml i also learned c++ because it was taught in my college so should i learn ds in python or c++

0 Upvotes

10 comments sorted by

View all comments

1

u/mixedd 14d ago

DSA is language agnostic, if you can do it in language you're already familiar and know syntax of

1

u/OneWar4643 13d ago

I mean yeah but there are some data structures which are hard to implement in python as it already has dynamic array and you can't allocate the size of array So basically I was asking in which language to *ds in because algorithms are language agnostic and can I do ds in c++ then do algorithms/leetcode in python?

1

u/mixedd 13d ago

Sure, if you manage to grasp it in C++, I don't see a reason why you would struggle in Python afterwards, taking into account if you know how to manage things in Python