Activity 01
Pair Programming: BFS Maze Challenge
Pairs sketch a simple grid graph as a maze, then code BFS to find the shortest path from start to goal. Switch roles for DFS version and compare paths printed from code. Discuss why paths differ.
Differentiate between BFS and DFS in terms of their exploration strategy and applications.
Facilitation TipDuring Pair Programming: BFS Maze Challenge, rotate pairs randomly halfway through so students see different approaches to the same maze.
What to look forProvide students with a small, unweighted graph represented by an adjacency list. Ask them to trace the execution of BFS starting from a specific node, listing the order nodes are visited and the contents of the queue at each step. Then, ask them to do the same for DFS.