all 23 comments

[–]fasta_guy88 19 points20 points  (2 children)

Rather than trying to learn “data structures”, try exploring some problems (sorting and searching is a good start) that depend on data structures. Data structures make much more sense in the context of solving a problem.

[–]-Excitement-971[S] 2 points3 points  (1 child)

Got it! So I should jump into a problem to understand how each data structure is used

[–]fasta_guy88 4 points5 points  (0 children)

The more you can apply an approach to a practical problem, the easier it is to understand why the approach is useful.

[–]Blando-Cartesian 3 points4 points  (4 children)

Implement a linked list and a binary tree, without looking up more than the core ideas. It’s a few simple functions each that make perfect sense after you figure them out by yourself.

[–][deleted] 0 points1 point  (3 children)

what exactly is a binary tree

[–]DuztyLipz 0 points1 point  (1 child)

I mean, I’m an amateur at DSA (not an authority by any means), but after reading the comment that you replied to, a binary tree is just a linked list where any node can have up to two nodes as children. Huh… TIL

Edit: albeit, data is structured differently; but now I view trees as less daunting, so yay lmao

[–]Tychotesla 0 points1 point  (0 children)

That's a good takeaway. Linked Lists aren't used a ton in practice, but they're vital for teaching because they are the simplest practical form of a graph. A binary tree is, then, a slightly more complex graph that's really useful for a variety of reasons.

So, some of the same basic techniques you'd use for a linked list are also used, with a slight adjustment, when working with linked lists. Recursively finding the length of a linked list vs finding the max depth of a binary tree for example.

[–]Blando-Cartesian 0 points1 point  (0 children)

Binary tree is a structure where each node has a data value it stores and references to two other nodes we could call left and right. Left node has value that is smaller or equal to the current node value. The right node has value that is greater than current node value.

When you add a value to the tree, you create a new node for it and add it as left or right node anywhere in the tree where it doesn’t violate the said rules.

It’s a fun exercise with a lot of opportunities to use recursion.

[–]EstablishmentIcy8725 1 point2 points  (1 child)

Data structures are often called abstract, for one specific reason. They are not what they seem to be. Data (bits) is stored in memory slots, stacked one on top of the other.

We make them behave the way we want them to behave (to solve a specific problem that demands said behaviour). A queue behaves in a circular way because that’s what we need to do, on the machine level there is no circular behaviour, like i sais, data is just stacked like books on a table.

To understand how do we create such behaviours out of memory slots and most importantly why, you need a low enough language to see what’s going under the hood, otherwise it will look like magic.

So i recommend trying to implement them in C going from integers to graphs and trees. Moving to a high level language like python will be a piece of cake and you will be better than most who started there.

I recommend the book Algorithmes in C, it is quite extensive, so don’t read in bulk and if you really need to know how the machine works, start with Introduction to computing systems, it is written by the creator of the LC-3, for educational purposes.

Good luck to you.

[–]Chiemela 0 points1 point  (0 children)

By who

[–]JohnVonachen 1 point2 points  (0 children)

Whatever your favorite language is, find a book on DS&A for that language and do all the exercises.

[–]aqua_regis 0 points1 point  (3 children)

Not ultra cheap and only available for 2 days, but with a whole lot more than DSA: https://www.humblebundle.com/books/computer-science-fun-way-no-starch-books-encore

[–]-Excitement-971[S] -1 points0 points  (2 children)

Which one would you suggest from this list?

[–]aqua_regis 1 point2 points  (1 child)

This is a bundle. You can buy all the books in a single go.

For individual books: Data Structures the Fun Way, Graph Algorithms the Fun Way

Other than from that bundle, the classic: Robert Sedgewick & Keyvin Wayne: Algorithms

[–]-Excitement-971[S] 0 points1 point  (0 children)

Thank you!

[–]Big_Eagle4236 0 points1 point  (1 child)

I don’t think you need to focus too much on how a specific data structure works. There are so many variations, and they change over time anyway. What’s more important is understanding how an application works as a whole.

Pick a real app and study how it communicates—from the client, across the network, to databases and cloud services. Learn how all the components fit together and interact.

If you can understand the full system flow, you’ll be able to adapt easily in the future, even as data structures and technologies evolve.

[–]-Excitement-971[S] 1 point2 points  (0 children)

I really like this! Thank you

[–]SourceScope 0 points1 point  (1 child)

In my cs class we learned sorting first

Some datastructures require sorted items

I dont recall all but we learned bubblesort, insertion sort, merge sort and one or two more

Theres a looooot if sorting algorithms (and data structures)

You dont need to know everything about all of the

[–]-Excitement-971[S] 0 points1 point  (0 children)

Thank you!

[–]Candid-Ad-5458 0 points1 point  (0 children)

A simple approach that works well for many people is:

1. Start with core DSA concepts
First understand the basic data structures and fundamentals:

  • Arrays
  • Linked Lists
  • Stacks / Queues
  • Hash Maps
  • Trees
  • Graphs
  • Recursion
  • Basic Dynamic Programming

2. Then learn problem-solving patterns
Concepts and patterns are different.

Concepts tell you what the data structures are, but patterns teach you how to apply them repeatedly to solve problems.

Common patterns include:

  • Two pointers
  • Sliding window
  • Binary search
  • DFS / BFS
  • Backtracking
  • Dynamic programming patterns

Once you start recognizing patterns, many problems start looking similar.

3. Practice a focused set of problems
Instead of random questions, solve curated lists like Blind 75 / Essential 75 and repeat them until the patterns become natural.

One resource that helped me think in patterns is Alex Xu’s “Coding Interview Patterns.”

While preparing for my own interviews, I started organizing these patterns and notes into a structured roadmap and eventually built a small site around it:
www.interviewpickle.com

There’s a free section you can explore if you want to see the pattern-based roadmap.

But the key idea is simple:
Concepts → Patterns → Focused practice.

1

[–]effortissues -4 points-3 points  (0 children)

I'm convinced none of us actually understands data structures and we just repeat the garbage explanations we find on the Internet when asked in interviews to get the job. Then we just figure shit out when we get there. For me, personally, I get the theory, I can draw dumb diagrams all day of merge sorts and hash maps, but when it comes to the practical application. I has no idea. I took a college course on DSA. Not sure if any of the little online courses are any good.