Should I Learn Data Structures and Algorithms in Python or Switch to C++ or Java?

September 12, 2026 2 answers
Asked by top-to-bottom-pass
I'm a first-year B.Tech CSE student at a lesser-known college, and I'm already comfortable with Python basics including loops, functions, strings, built-in data structures, file I/O, and introductory OOP. I'm also building a contact-book project from scratch with add, search, and delete features, file-based storage, and classes. I'm planning to start learning data structures and algorithms soon. Is Python a sensible language for practicing DSA and coding problems, or should I learn C++ or Java first? I'd especially appreciate advice from people who have gone through this stage, including anything you wish you had known earlier.

Answers

tessellate!
The core ideas behind data structures and algorithms arenโ€™t tied to any particular programming language. Focus first on concepts like complexity, arrays, linked lists, stacks, queues, trees, graphs, sorting, and searching. You can implement and practice them in Python just fine. Also, keep in mind that studying DSA and solving coding-platform problems arenโ€™t exactly the same thing. Coding problems are one way to apply DSA, not the entire subject. Once you understand the concepts, you can practice them in whichever language youโ€™re most comfortable using.

top-to-bottom-pass: That distinction helps. Iโ€™ll look for resources that explain the underlying concepts instead of only following language-specific problem-solving tutorials.

Reply to this answer
!untangle this
Thereโ€™s no urgent reason to switch. Python is perfectly suitable for learning DSA and is often convenient for solving interview-style problems because the syntax is concise and its standard library is useful. C++ or Java may still be worth learning later, depending on the companies, coursework, or roles youโ€™re targeting. For now, building a solid foundation and consistently practicing matters much more than choosing the โ€œperfectโ€ language.

top-to-bottom-pass: Understoodโ€”I'll keep using Python for now and consider another language later if my coursework or target roles make it necessary.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions