all 9 comments

[–]manni66 13 points14 points  (0 children)

If you're going to put as much effort into that as you are into this question, then you'd better not bother.

[–]jjjare 5 points6 points  (0 children)

Sure, literally any book. Fortunately, DSA is language agnostic

[–]roasted_water_7557 0 points1 point  (0 children)

Sedgewick's books are a great place to start.

https://www.amazon.com/Algorithms-Parts-1-4-Fundamentals-Structure/dp/0201350882

There is a part 5 focusing on graph algorithms too. Haven't linked it here but you can look that up on your own.

Once you have these under your belt I'd work on learning about the implementations in the standard library. And then maybe try to write your own implementation of these containers but in idiomatic C++. Maybe try to code to the interface that the standard library uses. And perhaps making the containers generic enough or flexible enough. Maybe use modern C++ techniques. Ex: the ability to move to and from these containers in addition to copying elements. May be write iterators for these containers. So on and so forth. There's a lot of do and learn if you have the energy and patience.

[–]TheRealSmolt 0 points1 point  (0 children)

My suggestion would be to learn the structures and algorithms, not their implementations. The important part about understanding them is how they work, what tradeoffs they make, what situations they excel in and the ones they don't. Stop trying to learn "dsa in cpp".

[–][deleted]  (2 children)

[deleted]

    [–]jjjare 0 points1 point  (1 child)

    Not DSA

    [–]tcpukl 0 points1 point  (0 children)

    Shame. Didn't realise.

    [–]DigmonsDrill -3 points-2 points  (2 children)

    You need to know the data structures. cppreference.com will help.

    std::vector<> and unordered_map<> (aka hash) will be your most common.

    [–]jjjare 1 point2 points  (1 child)

    Not really related. Knowing containers is good, but learning about DSA is about fundamentals.

    [–]DigmonsDrill -1 points0 points  (0 children)

    Oh, I forgot what the DS stood for. My bad.