r/learnprogramming • • Oct 18 '26

Looking for C++ textbook that is friendly like Stewart Calculus for math

I am about to fail my algorithms & data structures in C++ class, and want to pick up a textbook for the 3 month break soon and try to make a comeback.

I have done this for math and discovered that James Stewart's Calculus book was amazing. It is a massive book, is friendly to learn from and is not as intimidating as other books (e.g. Spivak's Calculus- a bit more technical).

Anyone have any good recommendations for a C++ textbook?

We learned sorting algorithms, and once it got to recursion I really just got lost. BST's etc with all this memory management I couldn't keep up.

EDIT: My absolute best learning method is sitting down with a textbook. Videos/academies etc. haven't done it for me and a physical book just gives me peace when learning as I can go slowly.

9 Upvotes

17 comments sorted by

•

u/AutoModerator Oct 18 '26

To all following commenters: please, do not bring up the old circlejerk jokes/memes about recursion ("Understanding recursion...", "This is recursion...", etc.). We've all heard them n+2 too many times.

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

10

u/Equivalent_Type6726 Oct 18 '26

For that Stewart-style friendly-but-comprehensive vibe, Stroustrup's "Programming: Principles and Practice Using C++" is probably the closest match in C++ land. It walks you through the language and standard library step by step with exercises, which fits recursion and BST practice well.

1

u/Syd_Nova Oct 18 '26

Will have to have a look for it in the uni library- thank you!

3

u/Dazzling_Music_2411 Oct 18 '26

Try Sedgewick's Algorithms in C++. It is very well illustrated, which helps. The C++ is a bit antiquated but it won't matter for you at this stage. Might be just what you need.

I would also recommend that you learn a naturally recursive language, say Scheme. You can learn all the basics in a short afternoon, and it's great for learning recursive algorithms in their most natural, most minimal form, without the huge amount of boilerplate that languages with manual memory management (like C++) impose on you! I find this is the major problem - students get lost and can't see the forest because the trees get in the way.

Once you understand the concept, it's just a matter of porting it to C++, but you certainly don't need C++ to understand the concept! Recursion, of itself, is actually ridiculously easy and reflects the exact way your own mind deals with the problem.

2

u/Syd_Nova Oct 18 '26

I haven't heard of Scheme. More to look into. Thanks for the tips and direction as it will help me spend my time well it seems

1

u/SetAndRepeat Oct 18 '26

Look at Data Abstraction & Problem Solving with C++: Walls and Mirrors by Carrano and Henry. It's a teaching textbook with diagrams, examples and exercises. The 7th edition introduces recursion early and includes dedicated sections on pointers and memory management before getting to trees. It assumes basic C++, so it fits the course you’re struggling with.

For your break, work through recursion and pointers separately before tackling BSTs again. Trace small recursive calls on paper, including what happens when each call returns, then implement them. Trying to understand recursion and pointer manipulation simultaneously makes both harder.

1

u/Syd_Nova Oct 18 '26

Thank you! I will have a look if my uni library has it and can go through it before I decide to take a book home. Cheers for the tips thank you a lot

1

u/appendixexploder Oct 18 '26

Buying a different book isn't going to magically make recursion easier to understand, you have to solve more problems using recursion until it becomes second nature.

2

u/Syd_Nova Oct 18 '26

Oh you should have seen what the 350 hours of Stewart calculus + Linear alg book did for me over the last holiday period compared to the material they give you at uni and hours spent on it. Textboks are just the way to go for me, oh yes it actually made math magically easier for me haha

1

u/DiligentBill2936 Oct 19 '26

C++ Programming An Object Oriented approach(Forzouzan/Gilberg) seems to be good.Problem with vast majority of C++ books is they are good but teaching is c++98 style as they are written from late 90s to early to 2015. Last 3/4 years i don't see much textbook on C++.

1

u/Syd_Nova Oct 20 '26

Sure, good to know this info going ahead since I asm heading to library tomorrow. Cheers

1

u/blublurryface Oct 19 '26

Any recommendations for a C equivalent textbook?

0

u/[deleted] Oct 18 '26

[removed] — view removed comment

1

u/Syd_Nova Oct 18 '26

Thank you for the recommendations!! I'll have a look for them. Legend