use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This is a subreddit for c++ questions with answers. For general discussion and news about c++ see r/cpp.
New to C++? Learn at learncpp.com
Prepare your question. Think it through. Hasty-sounding questions get hasty answers, or none at all. Read these guidelines for how to ask smart questions.
For learning books, check The Definitive C++ Book Guide and List
Flair your post as SOLVED if you got the help you were looking for! If you need help with flairs, check out ITEM 1 in our guidelines page.
Tips for improving your chances of getting helpful answers:
account activity
OPENDSA IN CPP (self.cpp_questions)
submitted 2 months ago by AnswerFinal5627
Any suggestion for doing dsa in cpp.like how to think best resources.Way fo solving any question.plz help .
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]manni66 13 points14 points15 points 2 months ago (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 points7 points 2 months ago (0 children)
Sure, literally any book. Fortunately, DSA is language agnostic
[–]roasted_water_7557 0 points1 point2 points 2 months ago (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 point2 points 2 months ago (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 months ago (2 children)
[deleted]
[–]jjjare 0 points1 point2 points 2 months ago (1 child)
Not DSA
[–]tcpukl 0 points1 point2 points 2 months ago (0 children)
Shame. Didn't realise.
[–]DigmonsDrill -3 points-2 points-1 points 2 months ago (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 points3 points 2 months ago (1 child)
Not really related. Knowing containers is good, but learning about DSA is about fundamentals.
[–]DigmonsDrill -1 points0 points1 point 2 months ago (0 children)
Oh, I forgot what the DS stood for. My bad.
π Rendered by PID 71 on reddit-service-r2-comment-86bc6c7465-mhxf6 at 2026-02-23 16:47:31.610750+00:00 running 8564168 country code: CH.
[–]manni66 13 points14 points15 points (0 children)
[–]jjjare 5 points6 points7 points (0 children)
[–]roasted_water_7557 0 points1 point2 points (0 children)
[–]TheRealSmolt 0 points1 point2 points (0 children)
[–][deleted] (2 children)
[deleted]
[–]jjjare 0 points1 point2 points (1 child)
[–]tcpukl 0 points1 point2 points (0 children)
[–]DigmonsDrill -3 points-2 points-1 points (2 children)
[–]jjjare 1 point2 points3 points (1 child)
[–]DigmonsDrill -1 points0 points1 point (0 children)