I tweeted about how learning the fundamental data structures first helps you learning more advanced ones.

I thought I might present to you the order in which I would learn them, together with some explanations.

🧵👇 https://twitter.com/oliverjumpertz/status/1296757563648868352?s=20
1) Arrays

Learn about native arrays first.

Not JavaScript's Array (that's a dynamic array), not Python's list (that's also a dynamic structure).

This will give you the fundamentals for dynamic arrays and other array backed structures.

Try to really understand them!
2) LinkedLists

Start with a Singly Linked List, based on that go to the Doubly Linked List.

This provides you with a real awesome foundation for all data structures that are based on inter-linked objects.

After that, learn about Circular Linked Lists.
3) Queues

Queues and Dequeues are the first data structures where you can apply your knowledge about dynamic arrays and linked lists.

They are nearly the same as the data structures you base them on, the only exception being that they provide a very specific API.
4) Stacks

Stacks are another data structure where you can apply your knowledge about dynamic arrays and linked lists.

Like Queues, they're the same as the data structures they're based on, only that they provide a very specific API.
5) HashTables

HashTables are usually backed by a (multi dimensional) dynamic array or a list structure.

You'll need the basic knowledge you already gained.

A new concept you will have to learn is hashing, and then combining this with finding the right spot for an element.
6.1) Trees

Start with Binary Trees. They are usually based on inter-linked objects, so your knowledge about LinkedLists and their Nodes helps a lot.

After that, cover Binary Search Trees, they are basically Binary Trees which have relative ordering (simplified!)
6.2) Trees

Cover AVL Trees next. They're self-balancing binary search trees.

From there on, go to the Red-Black Tree. This is another form of a self-balancing tree.

Next: B-tree.

It is similar to a Red-Black Tree in that is is self-balancing but not a binary search tree.
6.3) Trees

Last but not least: N-ary Trees.

Those are trees that can have up to N children on each Node.
7) Heaps

Heaps are a specialized tree-based data structure.

They are usually implemented using arrays.

Learning and implementing those will usually take you some time to grasp the concepts.

This is why I'd suggest working on them so late in your journey.
8) Graphs

The last thing in your journey to cover essential data structures should be graphs.

You can do a lot with graphs, and thus it takes some time to learn everything about them.

You'll combine a lot of the concepts you've learned before to implement them.
9) More

There are more data structures than only those.

But after you covered those and at least understood the basics of how they work and how they are implemented, you'll have such a solid foundation that other data structures will be easier for you to understand.
You can follow @oliverjumpertz.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled:

By continuing to use the site, you are consenting to the use of cookies as explained in our Cookie Policy to improve your experience.