Files
dsa-tutoring/notes-and-examples/2026.07.21/overview.md

749 B

Outline

To make our knowledge of graphs useful, we'll go over our first traversal method today: depth-first search. We will also go over breadth-first search, and how both algorithms can be useful.

Assignment: write functions for depth-first search and breadth-first search. Because there is no starter file, the constraints are listed below:

  • You may use either an adjacency list or adjacency matrix to represent your graph
  • You should demonstrate that your algorithm works by running it through some test cases
    • For each test case, specify the graph, starting point, and expected output(s)

Bonus: can you output all the valid paths for both DFS and BFS in a particular case?