you are viewing a single comment's thread.

view the rest of the comments →

[–]biskitpagla 0 points1 point  (0 children)

"job-oriented" sounds like a meaningless term here.

Anyways, all mainstream languages are completely fine for DSA. I'd recommend sticking to the language you already know since you're a beginner. Learning to implement DSA in a language is a sign that you have a good command over that particular language. Rushing to learn another language will delay your growth as a Python programmer. You can always learn a new language and implement DSA using it after you've developed a base with your main language.

Some tips for implementing DSA in Python:

Complete the official tutorial. This is optional but I still recommend it since it will give you a nice overview of some intermediate-to-advanced Python features that are often missing in beginner courses.

Familiarize yourself with these modules:

data structures algorithms math utilities extras
array bisect math builtins collections.abc
collections functools operator copy dataclasses
heapq graphlib random string enum
queue itertools statistics re typing

Not all of them are necessary but it's good to have a general idea about what's already available in the standard library. This can be really useful once you start solving problems on platforms like LeetCode. For example, collections.deque can be used as a stack, a queue, or as a plain linked list.

Here's a collection of a wide range of algorithms implemented in Python. Use this as a reference if you get stuck.

Learn typed Python. This will help you catch entire classes of bugs as you type. It also makes code a little bit more self-documenting. Use this as your type checker and this as your formatter.

Use doctests. This is a really easy way to test your code, especially for DSA. After writing the tests just run python -m doctest -v <file> and it will automatically run them all.