In this section, you applied DFS to grids and dependency graphs. You started with flood fill, where DFS spreads from a pixel to all same-colored neighbors. Then you used DFS to count islands by finding and erasing connected components.
You also learned cycle detection with three states: Unvisited, Visiting, and Visited. If DFS reaches a node that is still in the Visiting state, a cycle exists.
For Island Perimeter, you saw that not every grid problem needs traversal. A simple scan counting exposed edges was enough. Finally, Max Area of Island showed DFS returning values, not just marking nodes. Each recursive call returns the size of the component it explored.