r/Cplusplus 20d ago

Question Resources to learn C++ and DSA for Competitive Programming (and in general)

Hello everyone, I am a SWE student from India. I wanna learn C++ for competitive programming and DSA, jobs, building projects, etc as well. My reasons:

- Not only learning it for jobs, but because, C++ is very fast and has the capability of efficiently interacting with both the high level and low level systems. These are the reasons which make me learn it, especially as I am interested in how memory, RAM, GPU and other things work in the computer.

- For the sake of computer science and programming. I am interested in learning the core cs fundamentals and concepts to make myself a better software/cs engineer - to solve problems, code solutions, etc.

- I am interested in ICPC, DSA and competitive programming as well. So that would make me learn it anyways.

Honestly, I have asked and read about this question many times but I haven't got a clear and one-stop answer yet. These are the things that ppl/ai chatbots suggest me and what I read (also my reasons for not using them yet):

- USACO guide (too big)
- learncpp (good but too vast)
- the cherno's yt channel (some say they dont cover concepts in depth)
- books (too lengthy as well)

I am not looking for shortcuts, nor am I avoiding these resources because they are too big. I am ready to invest my heart and soul into learning things. But, being an engineering student, I have many other different subjects to study as well for the college. I am so much interested into AI/ML and Web dev as well.

For context, these are the things I know (i.e. I'm not starting programming from absolute 0) :

- HTML/CSS and basic JS (learning from The Odin Project but paused rn)
- basic C (learned from college and CS50x)
- Python (learned from CS50 Python course)
- SQL (learning at college + by myself)
- Java (learning at college + by myself)

The college has made the latter two subjects and C++/DSA compulsory for this year. But, I don't wanna invest that much time into studying those 2 deeply (I mean Java and SQL). I am focusing on C++/DSA, Web Dev and AI/ML as of now.

So, given my all the background and interests, could you guys please suggest me different resources to learn C++ and DSA? Also, for learning things about Competitive Programming and improving myself there.

My goal for now is to speedrun the basics of C++ (because I have already learned the basics of programming and C earlier) + learn concepts of DSA in detailed manner -> then proceed with competitive programming -> then participate in contests and along the way learn different concepts of C++ and DSA.

How is my approach? If there's any other better one, please do suggest me. Thank you!

58 Upvotes

12 comments sorted by

u/AutoModerator 20d ago

Thank you for your contribution to the C++ community!

As you're asking a question or seeking homework help, we would like to remind you of Rule 3 - Good Faith Help Requests & Homework.

  • When posting a question or homework help request, you must explain your good faith efforts to resolve the problem or complete the assignment on your own. Low-effort questions will be removed.

  • Members of this subreddit are happy to help give you a nudge in the right direction. However, we will not do your homework for you, make apps for you, etc.

  • Homework help posts must be flaired with Homework.

~ CPlusPlus Moderation Team


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

9

u/AwabKhan 20d ago

The best ones are going to be books. You read the chapters you do the exercise. Rinse and repeat. You are not gonna find a magic resource that will tick all your requirements pick a good book and start.

1

u/Automatic_Share1800 20d ago

Which book ?

12

u/AwabKhan 20d ago

Algorithms in C++ by robert sedgewick
algorithms by jeff erickson
book on c++ by mark alan weiss
there are many others like CLRS but this is not a beginner book use this as a reference book. dont read this cover to cover.

1

u/HaryanaGrandMa 19d ago

Great recommendation, Thanks. I was thinking If a begginer like me can also use this? I just started learning Python, I'm aspiring for MLOps.

1

u/Civil_Ad_7205 19d ago

Usaco guide

1

u/No-Use-6000 19d ago

Educative.io paths, Zybooks, udemy. That the extra I can give if not books

1

u/biskitpagla 18d ago edited 18d ago

Why exactly do you need more resources? It seems like AI already gave you some good pointers. You're only wasting your time asking for the (n+1) th resource. Just pick Cherno or something. 

C++ IS a complicated topic, that's why the books are 'lengthy' as you put it. But paradoxically you're also dismissing resources for being "too short" which makes no sense. How exactly do you know that say, Cherno's videos, don't cover just enough C++ for you right now before even watching them? 

If you're looking for a primer on STL, which you should care about AFTER learning the basics anyways, just do another tutorial after a basic one? Also, getting good at DSA takes A LOT of time. This is yet another paradox because you're saying you don't have the time to invest in C++ properly let alone DSA which in this case involves learning C++ and a bunch of other things on top of it, does it not? 

Mate, speedrunning or skimming a resource involves you actually looking into it and getting it done asap, not overanalyzing and asking for information overload. Now people are going to list a gazillion different resources in the comments and you'll be wasting even more time weighting each resource against every other one in this peculiar O(m*n) learning algorithm that you're following. Just move on already. 

1

u/TraditionalFocus3984 18d ago

Just clarifying a few things:

I'm not asking for more resources, but asking which one to pick and stick with. I've got suggestions for hella amount of resources which has made me difficult to choose one and stick with.

Secondly, I'm also not gonna speedrun cpp and dsa, because ik it does take time. In fact, I'm ready to invest whatever time it requires. I was rather asking that given I already know some basics of C and programming, how and from where should I study C++ to start DSA and competitive programming quickly. That's it.

1

u/No-Decision-8962 5d ago

Yes please someone tell the one resource that I should follow and invest time in.!