W3docs

JavaScript Data Structures - The Fundamentals

Learn all the core basics about JS data structures - both built-in ones like Maps, Sets or Arrays as well as custom ones like Linked Lists, Trees, Graphs etc.

Start course

When working with JavaScript, you'll work with data structures all the time.

That includes built-in ones like Arrays, Objects, Maps or Sets but - especially if you dive deeper into JavaScript - also custom data structures like Linked Lists, Trees or Graphs.

This course covers it all!

We'll recap the basic built-in data structures to understand how they work and when to use them, before we then explore important custom data structures.

In detail, this course covers the following structures:

  • Arrays (built-in)
  • Objects (built-in)
  • Sets (built-in)
  • Maps (built-in)
  • Linked Lists (custom)
  • Stacks (custom)
  • Queues (custom)
  • Hash Tables (custom)
  • Basic Trees (custom)
  • Binary Search Trees (BST, custom)
  • AVL Trees (custom)
  • Priority Queues (custom)
  • Heaps (custom)
  • Graphs (custom

You will learn how those different data structures work, when they might be helpful, how to build them and of course we'll also explore their time complexity (Big O notation)!

You'll get both the theory as well as practical examples to ensure that you fully understand all those key structures and you're able to work with them on your own after you finished this course - no matter if you need them for your next project or simply to ace an upcoming job interview!

To get the most out of this course, you should ensure that you have a basic understanding of JavaScript algorithms and that you especially understand the concept of time complexity and "Big O" notation. In case you're missing those prerequisites right now, you can explore our Algorithms course!

Course content

Section 1Getting Started

  • Welcome to the Course!
    1:11
  • What are "Data Structures"?
    4:58
  • Course Resources
    1:00
  • Arrays: Recap
    8:57
  • Sets: Recap
    5:46
  • Arrays vs Sets
    1:34
  • Objects: Recap
    7:05
  • Maps: Recap
    7:37
  • Objects vs Maps
    1:43
  • WeakSet and WeakMap
    2:16
  • Linked Lists (A First Custom Data Structures)
    2:46
  • Starting with Linked Lists and "append"
    13:19
  • Outputting the Linked List
    4:58
  • Prepend to Linked Lists
    4:09
  • Deleting Nodes
    10:31
  • "find" and "insertAfter"
    6:56
  • Linked Lists: Why and Time Complexity
    5:28
  • Linked Lists vs Arrays
    7:06
  • Module Resources
    1:00

Section 2Lists & Tables

  • Module IntroductionPremium
    0:55
  • What are "Lists" and "Tables"?Premium
    4:22
  • Built-in Lists and TablesPremium
    3:42
  • Introducing "Stacks"Premium
    5:51
  • Building a "Stack" Data StructurePremium
    7:01
  • Considering a Linked List StackPremium
    2:41
  • Stacks with Linked ListsPremium
    9:12
  • Stacks: Time ComplexityPremium
    4:50
  • Introducing QueuesPremium
    3:24
  • Building a QueuePremium
    4:34
  • Linked Lists & QueuesPremium
    5:09
  • Queue Time ComplexityPremium
    4:45
  • Introducing Hash TablesPremium
    4:18
  • Why we need TablesPremium
    9:54
  • Building a Basic Hash TablePremium
    12:20
  • Understanding Hash CollisionsPremium
    4:58
  • Solving Collisions with ChainingPremium
    11:51
  • Solving Collisions with Open AddressingPremium
    10:42
  • Hash Tables: Time ComplexityPremium
    7:04
  • Hash Tables: SummaryPremium
    4:46
  • Module ResourcesPremium
    1:00

Section 3Trees

  • Module IntroductionPremium
    1:35
  • What are "Trees"?Premium
    3:28
  • Core TerminologyPremium
    8:58
  • An Example TreePremium
    2:43
  • A First Tree in CodePremium
    11:16
  • A Better Filesystem TreePremium
    14:10
  • Removing Tree NodesPremium
    7:06
  • Describing Our TreePremium
    6:49
  • Trees: Time ComplexityPremium
    4:42
  • Depth-first vs Breadth-first SearchPremium
    2:21
  • Implementing Depth-first SearchPremium
    6:01
  • Implementing Breadth-first SearchPremium
    3:27
  • Depth-first Search vs Breadth-first SearchPremium
    5:06
  • Introducing Binary Search Trees (BST)Premium
    3:34
  • Adding Values to BSTPremium
    6:27
  • Finding Values in BSTPremium
    10:13
  • Removing Leaf Nodes in BSTPremium
    7:46
  • Removing "One-Child" Nodes in BSTPremium
    5:12
  • Removing "Multi-Child" Nodes in BSTPremium
    12:09
  • BST Time ComplexityPremium
    3:38
  • Introducing AVL TreesPremium
    3:08
  • Balancing Trees with RotationsPremium
    4:05
  • Understanding Balance FactorsPremium
    2:59
  • Adding Depth and Balance FactorsPremium
    6:25
  • Finding the Right RotationPremium
    8:07
  • Implementing Left RotationPremium
    9:50
  • Implementing Right RotationPremium
    3:21
  • Implementing Left-Right RotationPremium
    8:10
  • Implementing Right-Left RotationPremium
    3:28
  • Testing the AVL TreePremium
    3:06
  • AVL vs BSTPremium
    1:05
  • Introducing TriesPremium
    3:35
  • Building a TriePremium
    12:01
  • Finding Nodes in a TriePremium
    3:24
  • Deleting KeysPremium
    3:57
  • Tries: Time Complexity and Comparison to Hash TablesPremium
    5:41
  • Module ResourcesPremium
    1:00

Section 4Priority Queues & Heaps

  • Module IntroductionPremium
    0:37
  • Understanding Priority QueuesPremium
    2:03
  • Building a Regular QueuePremium
    4:22
  • Priority Queues & Time ComplexityPremium
    2:07
  • Building a Basic Priority QueuePremium
    7:33
  • Introducing HeapsPremium
    3:22
  • Exploring the Heap ConceptPremium
    5:50
  • Building a HeapPremium
    11:20
  • Processing ItemsPremium
    11:51
  • A Heap-based Priority QueuePremium
    4:34
  • Heaps & Time ComplexityPremium
    5:53
  • Module ResourcesPremium
    1:00

Section 5Graphs

  • Module IntroductionPremium
    0:37
  • Graphs: What and Why?Premium
    6:01
  • Graphs with an Adjacency MatrixPremium
    9:56
  • Using Adjacency Lists InsteadPremium
    4:27
  • Adjacency Lists vs MatricesPremium
    5:44
  • Building a Graph StructurePremium
    7:06
  • Adding Graph MethodsPremium
    7:01
  • Removing Nodes & EdgesPremium
    10:47
  • Using Sets in GraphsPremium
    7:14
  • SummaryPremium
    1:08
  • Building a Social Network GraphPremium
    5:53
  • Module ResourcesPremium
    1:00

Section 6Summary & Next Steps

  • Course SlidesPremium
    1:00
  • Next StepsPremium
    1:00

Course instructor

Photo of Maximilian Schwarzmüller

Maximilian Schwarzmüller

As a self-taught professional I really know the hard parts and the difficult topics when learning new or improving on already-known languages. This background and experience enable me to focus on the most relevant key concepts and topics. My track record of many 5-star rated courses, more than 1,000,000 students worldwide as well as a successful YouTube channel is the best proof for that.

The most rewarding experience for me is to see how people find new, better jobs, build awesome web applications, work on amazing projects or simply enjoy their hobby with the help of my content. That's why, together with Manuel Lorenz, I founded Academind to offer the best possible learning experience and to share the pleasure of learning with our students.