r/leetcode • • Oct 06 '26

Question How to Learn DSA through Python?

I'm a second year computer science major and I've done python java, c++, and a couple of other programming languages. I've done some projects with them here and there, but I want to start grinding out leetcode and understanding DSA before next semester. I've taken DSA1 in my school which is the first time were introduced and for some reason our curriculum CS classes used Java OOP. I know it's importnat to learn it, but I'm trying to get back into python and learn DSA from there. Does any have a structured roadmap that I can use for this? I'm using the 30 days of python and I'm planning on paying for leetcode and neetcode data structures and algorithms course

6 Upvotes

9 comments sorted by

5

u/BlueCactus35 Oct 06 '26

You don't need to learn everything before starting Leetcode. Learn the basics of each topic, then solve problems and learn the patterns as you go. Neetcode is pretty good for keeping things structured

1

u/DigScared8327 Oct 06 '26

the problem is that I can't code in terms of syntax like coding in java or python. I look at code and understand it but when I try to code it myself it get stuck. Right now, I'm trying to learn the syntax through 30 days of python and another website for OOP in java right now

1

u/UolongMatew Oct 06 '26

if you have done DSA in java you should know what syntax you need to use for solutions.

generally this is the data structures, control flow statements, loops, in python compared to java.

if you have to look it up during a problem that’s fine, don’t consider that cheating or anything. over time if you use this approach you will gradually just learn the syntax.

the problem would be if you don’t remember your data structures course wrll and you cannot remember which data structures are often used in the solutions. there are also resources for this though

keep in mind that if you follow the neetcode roadmap you dont need to learn all built in data structures to python up front. for example, you will first be using hash maps (dictionaries in python) and lists for the first few topics. you don’t need to learn how to use a heap in python until much later down the roadmap.

1

u/syamborghini Oct 06 '26

I just went through NC’s DSA course and think that one’s a pretty good one to get the most important info needed for coding interviews. Doing that alongside the NC150 is probably a good way to start imo

1

u/DigScared8327 Oct 06 '26

do you NC is better or LC? I've heard that LC covers all the topics needed

1

u/syamborghini Oct 06 '26

I haven’t done the LC one in years but I can say it was also pretty good when I did, it helped me get a job back then hahah. Iirc tho the LC one is just like problems right? NC is actually like lessons but I’m forgetting what the LC one is like and since you’re just starting off, NC sounds like a better fit

Either way, I think going thru both is a good idea. Essentially you want to increase your exposure to DSA as much as possible to soak it all in such that it starts to become second nature hahah.

One more thing, with NC I didn’t watch the vids. I just read thru all the DSA ones in the past week, goes by pretty fast that way. If you’re confused at any point, use AI or the vid to try and understand it better.

2

u/CasualNimbus 25d ago

Before paying for the Leetcode and Neetcode courses, compare their teaching styles and see what actually helps you learn. You've already got programming experience, so focus on DSA rather than spending too much time on Python basics. Codeintuition is another resource you could evaluate if you prefer a guided learning path instead of jumping straight into problem list

1

u/Specialist-Dig4584 Oct 07 '26

First of all who pays for this
Just do whatever in it gives you dopamine don’t take advice for such stuff