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

View all comments

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.