r/learnprogramming • • 25d ago

Resource Book recommendations to understand DSA and algorithms from scratch (as a working developer)

Hey everyone!

I'm a full-stack developer with around 2 years of experience, primarily working with the following tech stack:

- Backend: C#, .NET, Entity Framework

- Database: Microsoft SQL Server

- Frontend: Angular, TypeScript, JavaScript

- Other: Basic experience with Blazor and Azure.

Most of my professional experience has been focused on application development, building UI components, integrating APIs, working with databases, and implementing business logic.

However, I feel I need to strengthen my fundamentals in Data Structures and Algorithms (DSA). I want to understand how different data structures and algorithms actually work, why we use them, when to use them, and how to approach problem-solving.

I'm looking for books that:

  1. Explain DSA concepts in very simple, beginner-friendly language.

  2. Use visual illustrations and practical examples wherever possible.

  3. Explain the logic behind algorithms rather than just providing code.

  4. Gradually progress from basic concepts to intermediate/advanced topics.

  5. Help develop problem-solving and logical thinking skills.

I've come across books like Grokking Algorithms and A Common-Sense Guide to Data Structures and Algorithms.

For those who have used these books or have other recommendations:

- Which book would you recommend for someone like me?

- Is Grokking Algorithms a good starting point?

- Are there any books that explain concepts particularly well for someone with a C#/.NET background?

I'm not necessarily looking for interview-cracking books. My primary goal is to genuinely understand DSA and build a strong foundation.

Thanks in advance!

14 Upvotes

12 comments sorted by

5

u/AstralIsles 25d ago edited 25d ago

A couple books were already recommended. I recommend manually programming the data structures at least once in your career. That will really bake into memory what the Big O notations are and why. You don't have to do the difficult ones like a concurrent hash map. But I would recommend a regular hash map, priority queue, linked list, ect.

3

u/Available_Safe1818 25d ago

Idk if it's what OP wants, but I like doing this while referring to Wikipedia's various pages on the DS and As.

2

u/LoL_is_pepega_BIA 23d ago

I had an interview where one of the easy questions was to literally search for and implement an algo in any prog lang by reading the wikipedia page.

Apparently grads these days can barely do that..

3

u/silver_hill96 25d ago

Grokking Algorithms is great for beginners but you'll eventually need something more detailed once you get past the basics

3

u/Dazzling_Music_2411 24d ago

Sedgewick, hands-down. Available in a number of languages.

2

u/notactuallyme93 25d ago

Grokking Algorithms is excellent at explaining the concepts, but you need to implement your own versions of the data structures and algorithms. And it is a good thing that you use C#, and not Python as the book does, because then you are "forced" to think and understand, more than just typing.

2

u/bizvibe8 25d ago

Between Grokking Algorithms and A Common-Sense Guide to Data Structures and Algorithms (by Jay Wengrow), Wengrow\’s book is generally much more useful for a working developer. Grokking is great for visual mental models, but it is quite high-level and ends right around basic sorting and graph traversals. Wengrow walks through the actual trade-offs (arrays vs linked lists, hash table collisions, binary search trees, heaps, and dynamic programming) with clear diagrams and practical code without getting bogged down in heavy mathematical proofs.

For your C# and .NET background specifically, pair your reading with how .NET actually implements these structures in the Base Class Library. Looking at the open-source dotnet/runtime implementations for List<T> (dynamic array resizing), Dictionary<TKey, TValue> (bucket array and collision resolution), and PriorityQueue<TElement, TPriority> (binary heap) makes the big-O trade-offs concrete in the code you write daily. Implementing a basic dynamic array, linked list, and hash map from scratch in a simple C# console app will solidify the memory and performance implications far better than any interview puzzle platform.

2

u/spidermask 24d ago

It's a big book that covers many things and one of the academic gold standards but I think regardless it's very good and fairly "easy to read" all things considered - Introduction to Algorithms (T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein).

It was both reference material for the DSA course at my Uni and for the more advanced course called Algorithmic Strategies (goes into topics mostly regarding competitive programming - recursion, backtracing, dynamic programming, greedy algorithms, graph algorithms etc).

To start tackling this topic I think it's important to understand Big O notation and learn to look at some simple code blocks and identify time and space complexity.

I wouldn't care so much about specific languages just use whatever you're comfortable, understanding pseudo-code is helpful at least.

From there on you go from the 1d array to 2darray, stack, list, linked-list etc (useful to maybe attempt to implement stack, list and tree "by hand" at least once or at least look at pseudode if you want to see how it works "underneath").

Learn how insertion, look-up and removal work, if it's the same to insert ordered data or not - is it worth sorting before or not, how will that affect the time complexity? - sorting is another topic important in DSA ofc.

This will start to slowly train your brain to think like ok in this situation I'll be doing plenty of insertion and removal so maybe X is better, in that situation it's mostly inserting and lots of look-ups but not so much removing so Y is better.

You're an experienced programmer already so you already know way better how things work in real life so it will be much easier for you to contextualize and understand how things scale compared to when I had that course in my BSc 😂. Ofc this is a bit of an academical approach but you can still go full hands on with it very simply by doing like:

  • Create three monstruous sorted data sets of numbers: sorted, unsorted and another only partially sorted - I think you'll see this being more significant when studying Trees.
  • Do insertion, look up and removal in the data structure(s) you're studying and track time, compare the results. -when you get to the sorting algorithms do the same thing.

Regarding the problem solving and logical thinking, they'll get better by practicing and looking at problems... I remember recursion took a long time to click, not the concept itself but actually looking at a problem and seeing it fit. Maybe attempt leet code problems if that's your jam.

And now after this I will be checking out the book recommended in the other comments!

1

u/edwbuck 24d ago

If you have not taken "Discrete Mathematics", then start with a book in Discrete Math. That's because all of the best DSA books start with terms from Discrete Math, on page one.

After that, most automata books should do. But the one I learned from, was John E. Hopcroft's "Introduction to Automata Theory, Languages and Computation (Addison-Wesley series in computer science)"

Learning a DFA is like learning building framing. It will only give you part of the picture, the "frame" or framework. To use it in a program, in anger, behind schedule, you need to learn something related, how to design the states in your DFA.

Good luck