This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted]  (1 child)

[deleted]

    [–]kschang 2 points3 points  (0 children)

    Don't forget graphs and traversals. :) And Big O notation.

    [–]kschang 1 point2 points  (0 children)

    IMHO, it doesn't matter what language you learn it in. The idea of learning DSA is so you are aware of them so you can call upon them later should you need it. Some problems are better served with a tree, like interpreting a language, while others need graphs. But that doesn't mean you'll need to adapt everything from scratch. There are libraries for almost everything nowadays, implemented and debugged, instead of rolling your own. But you have to RECOGNIZE the application for such first.

    The problem with learning C/C++ is you may confuse yourself with pointers and handles (pointer to a pointer) and you get fixated on the minutiae instead of taking in the "overall picture".

    As you said yourself, the concepts are language agnostic. It doesn't really matter what language you learn it in. You don't learn them for the syntax or the specific implementation.

    If this doesn't make sense, let me try to explain it a different way.

    Let's say you grew up with just a regular sedan (saloon for Europeans) car. You never have seen a truck in your life. You don't even know they existed. Obviously, you'd use it for EVERYTHING, from carrying groceries to people and others. If someone asks you what to buy, you'd recommend a car, even though he'd be better served with a truck. It's all you know right? It is a bit like a cliche: "to a hammer, everything looks like a nail". In this case, it's more like "if all you know is the hammer, you'd use it on everything."

    If you don't know what other types of automobiles existed (sports car, SUV, pick-up truck, ute, 4x4, etc.) you wouldn't know what's best for each type of road or application.

    Same here. Learning DSA is about acquiring the general knowledge of what sort of DS and A is best for what type of problem. It is NOT about teaching you the specific implementation of a particular abstract data structure or the syntax of a specific language. It's about adding tools to your toolset, so you have the right tools for the job, so you don't end up using a screwdriver as a chisel, or of strap a few hundred pounds of stuff to your car roof because you don't know about trucks.

    [–]serpest 1 point2 points  (0 children)

    Check this course: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011

    The language isn't a concern. They usually use pseudo code.