Data Structures & Algorithms

Data Structures and Algorithms

How to reason about correctness and complexity, the core data structures every efficient program relies on, and the algorithmic strategies (search, sort, recursion, graphs, dynamic programming) built from them.

intermediate14 lessons6 modules9h total

Helpful before you begin (optional -- you can start this course now): JavaScript Fundamentals

Who it's for

Developers comfortable with variables, functions, conditionals, loops, and basic collections in JavaScript or TypeScript who want to reason rigorously about performance and choose the right structure deliberately, not by habit.

What you'll be able to do

  • Analyze an algorithm's time and space complexity using Big O, and distinguish best/average/worst case
  • Implement and choose between arrays, linked lists, stacks, queues, hash tables, trees, and heaps based on actual access patterns
  • Implement binary search, insertion sort, and merge sort, and justify which sort fits given constraints
  • Implement BFS and DFS over a graph, including cycle detection with a visited set
  • Implement a memoized recursive solution, and explain when backtracking, greedy, or dynamic programming actually applies

Not started — 14 lessons, no account required.

Start this course

Practice this course →Add to a study plan →Interview questions

Algorithm analysis and problem solving

Decomposition, correctness, testing, and the language of time/space complexity.

  1. Problem Decomposition, Correctness, and Testing Algorithms

    How to break an unfamiliar problem into solvable pieces, what it actually means for an algorithm to be correct, and why edge cases decide whether it really is.

    18 min
  2. Time and Space Complexity: Big O, Ω, and Θ

    How to describe an algorithm's growth rate independent of any specific machine, why worst-case matters most, and the difference between measuring and reasoning about performance.

    22 min

Sequential structures

Arrays, dynamic arrays, strings, and linked lists — and their real tradeoffs.

  1. Arrays, Dynamic Arrays, and Strings as Sequential Data

    Why fixed-size arrays give O(1) index access, how a dynamic array grows without becoming O(n) per insert, and strings as a special case of the same sequential-access tradeoffs.

    19 min
  2. Linked Lists: Nodes, Pointers, and When They Beat Arrays

    Building a singly linked list from individual nodes, and the specific, narrow situation where it genuinely outperforms a dynamic array.

    22 min

Access and lookup structures

Stacks, queues, deques, and hash-table-backed Sets and Maps.

  1. Stacks, Queues, and Deques

    Three restricted-access structures — last-in-first-out, first-in-first-out, and both ends at once — and the real problems each one solves cleanly.

    19 min
  2. Hash Tables, Sets, and Maps: Average O(1) Lookup

    How hashing turns 'is this present' into an average-O(1) operation, what a collision is, and why worst-case behavior can still degrade to O(n).

    21 min

Hierarchical structures

Binary trees and traversals, binary search trees, heaps, and priority queues.

  1. Binary Trees and the Three Depth-First Traversals

    How a hierarchical structure differs from every linear one you've covered so far, and the three classic ways to visit every node in a specific, meaningful order.

    22 min
  2. Binary Search Trees: Ordered Structure, O(log n) When Balanced

    The ordering invariant that makes search, insertion, and deletion O(log n) on average — and the honest reason that guarantee can quietly collapse to O(n).

    21 min
  3. Heaps and Priority Queues

    The array-backed tree that always gives you the smallest (or largest) element in O(1), and how it stays that way in O(log n) per update.

    21 min

Recursion, search, and ordering

Divide-and-conquer, linear and binary search, insertion sort, and merge sort.

  1. Recursion and Divide-and-Conquer

    Writing a function in terms of a smaller version of itself, and the specific strategy — split, solve, combine — behind some of the most important algorithms in this course.

    20 min
  2. Linear Search and Binary Search

    The two fundamental searching strategies — check everything, or repeatedly halve — and the one precondition binary search absolutely requires.

    19 min
  3. Sorting: Insertion Sort, Merge Sort, and Choosing Between Them

    A simple O(n²) sort you can trace by hand, a divide-and-conquer O(n log n) sort, and how to justify choosing one over the other under real, stated constraints.

    23 min

Graphs and algorithmic strategies

Graph representations, BFS/DFS, backtracking, greedy reasoning, and dynamic programming.

  1. Graphs: Representations, BFS, and DFS

    Modeling relationships that don't fit a tree's strict hierarchy, and the two fundamental ways to systematically visit every reachable node.

    23 min
  2. Backtracking, Greedy Reasoning, and Dynamic Programming

    Three algorithmic strategies for problems too large to brute-force honestly — when each one applies, and, just as important, when each one gives a wrong answer if misapplied.

    24 min