All courses

Data Structures and Algorithms for Game Devs

Pick the right structure and know why: lists, dictionaries, queues, stacks, grids, graphs and Big O, all through game problems.

156 lessons, about 34 h 3 min

Guest mode. Chapter 1 is fully playable. Sign up to open the rest and keep your progress.

Bits and bytes

12 lessons, about 2 h 29 min

How numbers really sit in memory: binary, hex, bit flags, packed values and the glitches that happen when a number runs out of room.

  1. Counting in binary Demo, +25 XP, 10 min
  2. Reading binary by hand Challenge, +20 XP, 10 min
  3. Hexadecimal Challenge, +20 XP, 10 min
  4. Predict the output: binary and hex Predict, +15 XP, 10 min
  5. Bit flags Challenge, +20 XP, 13 min
  6. Shifting bits Challenge, +20 XP, 13 min
  7. Negative numbers in binary Demo, +25 XP, 14 min
  8. Under the hood: the level 256 glitch Challenge, +20 XP, 13 min
  9. Spot the bug: the gold total Challenge, +20 XP, 10 min
  10. How much memory a map needs Challenge, +20 XP, 11 min
  11. Quiz: bits and bytes Quiz, +15 XP, 8 min
  12. Chapter project: Save code Boss, +100 XP, 27 min

Why structure matters

12 lessons, about 2 h 29 min. Pro chapter

The same game, fast and slow: count the work your code does and pick the structure that does less of it.

  1. Same result, different work Demo, +25 XP, 9 min
  2. Counting the work Challenge, +20 XP, 9 min
  3. Predict the output: best case and worst case Predict, +15 XP, 16 min
  4. How the work grows Challenge, +20 XP, 11 min
  5. Lookups by key Challenge, +20 XP, 11 min
  6. Finding duplicates Challenge, +20 XP, 11 min
  7. Under the hood: how a list grows Challenge, +20 XP, 12 min
  8. Adding at the front or the back Challenge, +20 XP, 12 min
  9. Building long text Challenge, +20 XP, 11 min
  10. Spot the bug: slow on big inputs Challenge, +20 XP, 12 min
  11. Quiz: picking a structure Quiz, +15 XP, 8 min
  12. Chapter project: Fast crowd check Boss, +100 XP, 27 min

Big O

12 lessons, about 2 h 43 min. Pro chapter

Big O without the math class: name how the work grows, spot hidden loops and pick the faster plan before you write it.

  1. Giving growth a name Demo, +25 XP, 9 min
  2. Constant time Challenge, +20 XP, 13 min
  3. Linear time Challenge, +20 XP, 13 min
  4. Predict the output: step counts Predict, +15 XP, 13 min
  5. Keeping the biggest part Challenge, +20 XP, 14 min
  6. Quadratic time Challenge, +20 XP, 13 min
  7. Halving: binary search Challenge, +20 XP, 15 min
  8. Under the hood: how fast sorting is Challenge, +20 XP, 12 min
  9. Spot the bug: the hidden loop Challenge, +20 XP, 12 min
  10. Memory has a cost too Challenge, +20 XP, 13 min
  11. Quiz: Big O Quiz, +15 XP, 8 min
  12. Chapter project: Speed report Boss, +100 XP, 28 min

Arrays and lists

12 lessons, about 2 h 50 min. Pro chapter

Inventories and enemy waves: how arrays sit in memory, fast removes, ring buffers, grids, object pools and your own list.

  1. Items in a row Demo, +25 XP, 11 min
  2. Swap and remove Challenge, +20 XP, 11 min
  3. Removing many in one pass Challenge, +20 XP, 12 min
  4. Predict the output: arrays and lists Predict, +15 XP, 15 min
  5. A ring buffer Challenge, +20 XP, 14 min
  6. Grids: 2D arrays Challenge, +20 XP, 14 min
  7. Under the hood: object pools Challenge, +20 XP, 16 min
  8. Arrays of structs Challenge, +20 XP, 15 min
  9. Spot the bug: the swap that skips Challenge, +20 XP, 11 min
  10. Build your own list Challenge, +20 XP, 12 min
  11. Quiz: arrays and lists Quiz, +15 XP, 8 min
  12. Chapter project: Wave manager Boss, +100 XP, 31 min

Dictionaries and hash sets

12 lessons, about 2 h 42 min. Pro chapter

Instant lookups: how a hash table works inside, TryGetValue, counting and grouping, set operations and keys of your own type.

  1. How a hash table works Demo, +25 XP, 13 min
  2. Build a tiny hash table Challenge, +20 XP, 12 min
  3. TryGetValue Challenge, +20 XP, 13 min
  4. Predict the output: dictionaries and sets Predict, +15 XP, 11 min
  5. Counting with a dictionary Challenge, +20 XP, 10 min
  6. Grouping Challenge, +20 XP, 12 min
  7. Set operations Challenge, +20 XP, 14 min
  8. Under the hood: keys of your own type Challenge, +20 XP, 16 min
  9. Spot the bug: the key that changed Challenge, +20 XP, 12 min
  10. Order is not promised Challenge, +20 XP, 13 min
  11. Quiz: dictionaries and sets Quiz, +15 XP, 8 min
  12. Chapter project: Loot tracker Boss, +100 XP, 28 min

Queues and stacks

12 lessons, about 2 h 27 min. Pro chapter

Turn order, spawn lines, undo, menus and replays: two structures that only take from one end, and why that keeps them fast.

  1. A line and a pile Demo, +25 XP, 8 min
  2. Turn order with a queue Challenge, +20 XP, 10 min
  3. Undo with a stack Challenge, +20 XP, 11 min
  4. Predict the output: queues and stacks Predict, +15 XP, 12 min
  5. A spawn queue Challenge, +20 XP, 10 min
  6. Menus and the Back button Challenge, +20 XP, 12 min
  7. Replaying inputs Challenge, +20 XP, 13 min
  8. Under the hood: inside a queue Challenge, +20 XP, 13 min
  9. A fixed-size undo history Challenge, +20 XP, 10 min
  10. Spot the bug: the redo that came back Challenge, +20 XP, 12 min
  11. Quiz: queues and stacks Quiz, +15 XP, 8 min
  12. Chapter project: Turn manager Boss, +100 XP, 28 min

Grids and spatial hashing

12 lessons, about 2 h 27 min. Pro chapter

Collision checks that scale: drop things into cells by position and only compare what is close.

  1. Only check what is nearby Demo, +25 XP, 9 min
  2. From position to cell Challenge, +20 XP, 9 min
  3. A grid of buckets Challenge, +20 XP, 10 min
  4. A spatial hash Challenge, +20 XP, 10 min
  5. Predict the output: cells and buckets Predict, +15 XP, 13 min
  6. Checking the neighbor cells Challenge, +20 XP, 11 min
  7. Picking a cell size Challenge, +20 XP, 11 min
  8. Moving objects between cells Challenge, +20 XP, 11 min
  9. Spot the bug: the blast that missed Challenge, +20 XP, 11 min
  10. Under the hood: a spatial hash without a Dictionary Challenge, +20 XP, 14 min
  11. Quiz: grids and spatial hashing Quiz, +15 XP, 10 min
  12. Chapter project: Collision grid Boss, +100 XP, 28 min

Searching and sorting

12 lessons, about 2 h 36 min. Pro chapter

Leaderboards and loot tables: write sorts by hand, keep ties in order, sort by several keys, find the top few fast and roll weighted drops with binary search.

  1. Sorting step by step Demo, +25 XP, 8 min
  2. Selection sort Challenge, +20 XP, 10 min
  3. Insertion sort Challenge, +20 XP, 10 min
  4. Predict the output: sorting Predict, +15 XP, 16 min
  5. Merge sort Challenge, +20 XP, 12 min
  6. Under the hood: stable and unstable sorts Challenge, +20 XP, 15 min
  7. Sorting by several keys Challenge, +20 XP, 13 min
  8. Spot the bug: the second sort Challenge, +20 XP, 10 min
  9. Finding the top few Challenge, +20 XP, 11 min
  10. Weighted loot tables Challenge, +20 XP, 14 min
  11. Quiz: searching and sorting Quiz, +15 XP, 8 min
  12. Chapter project: Loot and leaderboard Boss, +100 XP, 29 min

Recursion

12 lessons, about 2 h 38 min. Pro chapter

Methods that call themselves: nested menus and folders, flood fill, maze solving, how deep the stack can go and how to turn recursion into a loop.

  1. Smaller copies of the same problem Demo, +25 XP, 10 min
  2. Nested menus Challenge, +20 XP, 12 min
  3. Counting files in folders Challenge, +20 XP, 12 min
  4. Predict the output: recursion Predict, +15 XP, 17 min
  5. Flood fill Challenge, +20 XP, 11 min
  6. Counting rooms Challenge, +20 XP, 11 min
  7. Spot the bug: the reveal that leaks Challenge, +20 XP, 13 min
  8. Solving a maze with depth-first search Challenge, +20 XP, 12 min
  9. Under the hood: how deep the stack goes Challenge, +20 XP, 11 min
  10. Turning recursion into a loop Challenge, +20 XP, 13 min
  11. Quiz: recursion Quiz, +15 XP, 8 min
  12. Chapter project: Cave map Boss, +100 XP, 28 min

Graphs and pathfinding

12 lessons, about 2 h 40 min. Pro chapter

Rooms and doors as a graph: fewest steps with breadth-first search, the cheapest route with Dijkstra, and A* that heads straight for the goal.

  1. Rooms and doors Demo, +25 XP, 9 min
  2. Adjacency lists Challenge, +20 XP, 11 min
  3. Breadth-first search Challenge, +20 XP, 11 min
  4. Rebuilding the path Challenge, +20 XP, 10 min
  5. A grid is a graph Challenge, +20 XP, 11 min
  6. Predict the output: graph search Predict, +15 XP, 15 min
  7. Weighted edges: Dijkstra's algorithm Challenge, +20 XP, 12 min
  8. Under the hood: the priority queue Challenge, +20 XP, 13 min
  9. A* search Challenge, +20 XP, 15 min
  10. Spot the bug: the guess that is too high Challenge, +20 XP, 17 min
  11. Quiz: graphs and pathfinding Quiz, +15 XP, 8 min
  12. Chapter project: Route planner Boss, +100 XP, 28 min

Trees

12 lessons, about 2 h 46 min. Pro chapter

Parents and children: walk a tree two ways, move a scene graph, learn skills in order, keep scores in a search tree and give a goblin a behavior tree.

  1. Parents and children Demo, +25 XP, 9 min
  2. Measuring a tree Challenge, +20 XP, 12 min
  3. Depth first and breadth first Challenge, +20 XP, 12 min
  4. Predict the output: walk order Predict, +15 XP, 17 min
  5. A scene graph Challenge, +20 XP, 11 min
  6. A skill tree Challenge, +20 XP, 12 min
  7. A binary search tree Challenge, +20 XP, 11 min
  8. Under the hood: the lopsided tree Challenge, +20 XP, 14 min
  9. Spot the bug: the stale position Challenge, +20 XP, 13 min
  10. A behavior tree for a goblin Challenge, +20 XP, 14 min
  11. Quiz: trees Quiz, +15 XP, 8 min
  12. Chapter project: Goblin brain Boss, +100 XP, 33 min

Profiling

12 lessons, about 2 h 31 min. Pro chapter

Find the slow part instead of guessing: frame budgets, a profiler that counts, Total and Self, Amdahl's law, garbage every frame and caches.

  1. Finding the slow part Demo, +25 XP, 8 min
  2. The frame budget Challenge, +20 XP, 9 min
  3. A profiler that counts Challenge, +20 XP, 12 min
  4. Reading a profile report Challenge, +20 XP, 10 min
  5. Fix the biggest part first Challenge, +20 XP, 10 min
  6. Predict the output: profiles and budgets Predict, +15 XP, 12 min
  7. Under the hood: Stopwatch Challenge, +20 XP, 11 min
  8. Garbage every frame Challenge, +20 XP, 12 min
  9. Spot the bug: the query that runs again Challenge, +20 XP, 12 min
  10. Caching a result that does not change Challenge, +20 XP, 16 min
  11. Quiz: profiling Quiz, +15 XP, 8 min
  12. Chapter project: Frame report Boss, +100 XP, 31 min

Making a laggy game run smooth

12 lessons, about 2 h 45 min. Pro chapter

The course finale: the tower's big night runs slow, so measure it, find each slow system and fix it with the tools from the whole course.

  1. Measuring the big night Demo, +25 XP, 9 min
  2. Fast removal and a goblin pool Challenge, +20 XP, 11 min
  3. A queue for the spawn schedule Challenge, +20 XP, 11 min
  4. Arrow hits with a spatial hash Challenge, +20 XP, 10 min
  5. Predict the output: which fix helps most Predict, +15 XP, 16 min
  6. A top five without sorting everyone Challenge, +20 XP, 11 min
  7. Spreading the ward in one pass Challenge, +20 XP, 12 min
  8. One step map for every goblin Challenge, +20 XP, 12 min
  9. Spot the bug: the goblins nobody can hit Challenge, +20 XP, 13 min
  10. Horde totals without walking the tree Challenge, +20 XP, 12 min
  11. Quiz: making a game run smooth Quiz, +15 XP, 8 min
  12. Chapter project: The big night Boss, +100 XP, 40 min

© 2026 Xero Media LLC. All rights reserved.