All topics

Data structures and algorithms

Learners choose the right way to store data, reason about how fast a program runs, and check whether an algorithm is correct.

Outline

Who it is for: Learners who are comfortable with Python functions and lists and want to solve problems efficiently.

A program that works on ten records can slow down badly on ten thousand. Learners who know how data is stored and searched can build tools that stay fast as data grows. At the end, the learner can explain why one structure suits a problem better than another and measure the difference.

AI tools can write a sorting function or a tree from memory, so we spend less time on that. We spend more time on tracing, on reasoning about speed, and on choosing a structure, because these are what a programmer needs to judge whether an AI’s answer is right.

AI policy: Builders may use AI only as a tutor, with the teacher present, after they have shown the skill without it. Pioneers and adults may use AI after the checkpoint, and must test its code on edge cases and explain the speed in their own words. The checkpoint is done without AI.

Planned lessons

  1. Counting steps: a one-by-one search by hand and in Python
  2. Big O in plain words: how the steps grow as data grows
  3. Lists in memory: which operations are fast and which are slow
  4. Binary search on a sorted list
  5. Sorting: trace two sorts by hand, then use Python's sorted
  6. Stacks and queues
  7. Dictionaries (hash tables) for fast lookup
  8. Trees and tree traversal
  9. Graphs and breadth-first search: routes between villages
  10. Choosing the right structure for a problem
  11. Is this algorithm correct? Edge cases, tests, and judging an AI's answer

Teach it as

One sessionCount the steps of a one-by-one search and a binary search on paper, then time both in Python on a large list, in one 2 hour class.
One dayMorning: counting steps, Big O in plain words, and binary search. Afternoon: dictionaries for fast lookup, stacks and queues, and choosing a structure for a local problem.
One weekDay 1: counting steps and Big O in plain words. Day 2: lists in memory, binary search, and sorting. Day 3: stacks, queues, and dictionaries. Day 4: trees, graphs, and breadth-first search. Day 5 (Build and Show): checkpoint without AI (trace and compare on paper), then each learner explains which structure they chose for a problem and why.

Know this first

Standards this follows

Videos to download

No videos listed yet.