Unit: Data Structures, Graph Algorithms, and Shortest Paths (Computing, Grade 10)

Unreviewed AI draft. Written by Gemini 4 Argon (2026-11-05). No human teacher has reviewed this unit. All content is CC0 1.0 Public Domain.

Overview

Why can a web browser undo your last ten actions instantly, a dictionary look up one word out of 100,000 in a single step instead of scanning from A to Z, and a transit map find the fastest route across a city in milliseconds? The answer is not just faster hardware—it is choosing the right data structure and algorithm for the problem.

Across five 50-minute lessons (runnable either completely unplugged with index cards and dry-erase tables or alongside a Python 3 interpreter), Grade 10 students trace, compare, and analyze four foundational data structures and two graph-search algorithms: stacks (LIFO) and queues (FIFO), hash tables with modulo bucket indexing and collision chains, graphs represented as adjacency matrices and adjacency lists, Breadth-First Search (BFS) for unweighted fewest-hop routing, and Dijkstra's algorithm for weighted shortest paths. Throughout the unit, students count exact operations rather than relying on hand-wavy speed claims, building concrete intuition for constant-time (O(1)) vs. linear-time (O(n)) cost.

Prior knowledge

Learning goals

By the end of this unit, a student can:

  1. Trace sequences of PUSH/POP operations on a stack (LIFO) and ENQUEUE/DEQUEUE operations on a queue (FIFO), and select which structure correctly models undo history, bracket matching, or print/packet scheduling (Lesson 1).
  2. Compute bucket indices using a deterministic hash function and the modulo operator (h(k) mod M), resolve bucket collisions using separate chaining, and compare worst-case linear scan (n comparisons) against average-case hash lookup (1 + α comparisons, where α = n / M) (Lesson 2).
  3. Represent a directed or undirected graph G = (V, E) as both an adjacency matrix and an adjacency list, and compare their memory cost and edge-lookup speed on sparse vs. dense networks (Lesson 3).
  4. Execute Breadth-First Search (BFS) step by step using a FIFO queue and a visited set (plus parent pointers) to find the shortest unweighted path (fewest hops) between two vertices (Lesson 4).
  5. Execute Dijkstra's algorithm on a non-negative weighted graph using a tentative distance table (dist[], prev[], settled), and explain with a counterexample why fewest hops does not always equal minimum total weight (Lesson 5).

Lesson sequence

Lesson Title Time Core idea
Lesson 1 Who Goes Next? Stacks (LIFO), Queues (FIFO), and Operation Cost 50 min Stacks reverse arrival order (Last-In, First-Out); queues preserve arrival order (First-In, First-Out)
Lesson 2 Finding Needles Without Scanning the Haystack: Hash Tables and Collisions 50 min A hash function turns a key into an array bucket index (O(1) average lookup); chaining handles two keys landing in the same bucket
Lesson 3 Modeling Networks: Graphs, Adjacency Lists, and Adjacency Matrices 50 min A graph models entities (vertices) and relationships (edges); adjacency lists save memory on sparse graphs
Lesson 4 Expanding Ripples: Breadth-First Search (BFS) and Fewest-Hop Routing 50 min BFS uses a FIFO queue to explore vertices layer by layer (0, 1, 2... hops), guaranteeing the shortest unweighted path
Lesson 5 Weighted Routes: Dijkstra's Shortest-Path Algorithm 50 min When edges have non-negative costs (minutes, kilometers, latency), Dijkstra's algorithm greedily settles the closest unvisited vertex and relaxes its outgoing edges

Materials for the whole unit

Assessment summary

Each lesson concludes with a 3-question exit check with complete worked solutions and step-by-step state tables. Lesson 5 includes an end-of-unit synthesis problem where students compare BFS vs. Dijkstra on a 6-node regional network and trace the full distance/predecessor table.

Sources

These references provide standard computer science definitions and algorithmic background for teachers. All links were checked to load on 2026-11-05.

Known gaps and cautions