THE ATHENA LIBRARY
Algorithm Problem Set
CS 240 Teaching Team practice set
Set C
Graph traversal
1. Implement breadth-first search on an adjacency list and return the shortest path length between two nodes.
2. Use depth-first search to detect a cycle in a directed graph.
3. Compare the memory use of BFS and DFS on a wide, shallow graph.
Fictional educational sample written for the Athena demo · Page 29 of 64.
100%saved