A data structures and algorithms study roadmap

The order to learn the ten core areas, how to practice each one, and how to know when you're ready to move on.

By Judson Dunne. Updated November 7, 2026.

Most people study data structures and algorithms by opening a long problem list and starting at the top. They end up memorizing answers, then freeze on anything new. A better approach is to learn one pattern at a time, in an order where each one uses what came before.

The order

  1. Arrays & Strings. Indexing, in-place updates, string building and simple scans.
  2. Hash Maps & Sets. Frequency counting, seen-before checks and constant-time lookup.
  3. Two Pointers & Sliding Window. Pointer movement, substrings, subarrays and window optimization.
  4. Stacks & Queues. LIFO and FIFO, monotonic stacks and common applications.
  5. Binary Search. Sorted search spaces, boundaries and binary search on answers.
  6. Linked Lists. Traversal, pointer updates, reversing lists and cycle detection.
  7. Trees & Binary Search Trees. Binary trees, traversal orders, recursion and BST properties.
  8. Heaps & Priority Queues. Top-K problems, scheduling and priority-based selection.
  9. Graphs & Traversal. Representations, BFS, DFS, grids, connectivity and ordering.
  10. Recursion, Backtracking & Dynamic Programming. Search trees, choose-and-undo, memoization and state design.

Before or alongside all of this, make sure you can work out the complexity of your own code. Big-O isn't a separate topic. It's how you know whether a solution is good enough, so practice it on every problem.

Why this order works

Arrays and hash maps come first because many later solutions use them. Two pointers and sliding window are ways of moving through an array more carefully. Stacks and binary search introduce reasoning about state and boundaries. Linked lists make you comfortable with references, which you need for trees. Trees teach recursion, heaps build on trees, and graphs generalize them. Backtracking and dynamic programming come last because they need solid recursion and a clear idea of state.

How to work one problem

Take the classic: given a list of numbers and a target, find two that add up to it. Here's the sequence that builds real skill.

First, say the obvious answer. Check every pair. That's O(n²), and saying so out loud is useful even if you won't keep it.

def two_sum_slow(nums, target):
    for i in range(len(nums)):
        for j in range(i + 1, len(nums)):
            if nums[i] + nums[j] == target:
                return (i, j)
    return None

Then ask what work is being repeated. For each number, you're searching for its partner. Could you look it up instantly instead? That question leads to the hash map.

def two_sum(nums, target):
    seen = {}  # value -> index
    for i, n in enumerate(nums):
        if target - n in seen:
            return (seen[target - n], i)
        seen[n] = i
    return None

Then test it. Try an empty list, no valid pair, and duplicates like [3, 3] with target 6. That last one is why the lookup happens before the insert.

Finally, write down the pattern, not the problem: "When I'm searching for a partner, trade memory for a lookup." Over time, that log of patterns becomes more valuable than any list of solved problems.

An eight-week schedule

This assumes about an hour a day. If you have less time, spend it on your weakest areas instead of rushing through them all.

  • Week 1: arrays, strings, hash maps and sets.
  • Week 2: two pointers, sliding window, stacks and queues.
  • Week 3: binary search and linked lists.
  • Week 4: trees and binary search trees. Don't rush these.
  • Week 5: heaps, then graphs and traversal.
  • Week 6: recursion and backtracking, then an introduction to dynamic programming.
  • Week 7: more dynamic programming, plus sorting and greedy problems.
  • Week 8: mixed problems you haven't seen, on a timer, out loud.

How to know you can move on

Solving a problem once doesn't mean you've learned it. Move on when you can do all of these:

  • Solve a new problem of that type in about 25 minutes without hints.
  • Say which pattern it is and why before you start coding.
  • State the time and space complexity without working it out afterward.
  • Redo a problem you solved a week ago, from a blank file.

When you're stuck, try for about 20 minutes and then read a hint rather than a full solution. If you do read the solution, close it and write it yourself the next day. For interview-specific preparation, see the technical interview checklist. For college coursework, this order also lines up well with a course like CS 150.