Is javascript good for DSA?πŸ˜ΆπŸ‘¨β€πŸ’»

Photo by Tim Gouw on Unsplash

Is javascript good for DSA?πŸ˜ΆπŸ‘¨β€πŸ’»

Β·

2 min read

This is an opinion-based blog!!!! 😁

So for the past two years, I have been trying to learn DSA, but I failed every time. After two years of trying GFG, Codechef, and Leetcode with different approaches I chose leetcode and did some easy questions with help of discussion and solutions with JAVA.

Now the question is learning JAVA good for me?

The answer is that it will not benefit my career as I am a web developer, PHP and JS are in my stack so learning an extra language does not worth it for me. As I don't have to do CP so it would be great if, I do the DSA with the programing language that resides in my development stack.

I tried one simple 'two-sum' question with JAVA and JS. The only difference was the run time JAVA was taking 0ms while JS was taking 109ms but it does not matter as long as I am not doing competitive programming although there were solutions in js that were taking 0ms.

I checked almost 10-15 questions solutions and there were people 15% to 20% of people who have done that question with JS.

Advantage:

  • Along with DSA, I will get better at javascript.

Disadvantage:

  • Not enough resources for DSA in JS.

  • There are some limitations in JS.

Conclusion:

As long as I don't have to do CP, I should stick to my stack's programming language for DSA as it is language-independent.

Disclaimer: I am just a fresher and I may be wrong about this, feel to correct me. In the future maybe I would change my decision and go back to JAVA, I don't know.

Β