Click on Run Example DFS to see the algorithm traversal. Start the
Interactive DFS after the example has completed!
Click on the correct nodes that follow the DFS traversal path. Complete the
traversal and test your knowledge with a quiz!
Answer each question correctly with the knowledge you've accumulated. Move on to the coding activity when complete!
Fill in the blanks and run the code. Hints will be available on submission.
def dfs(graph, start):
visited = set()
stack = [] # blank #1
while stack:
node = stack.pop()
if node not in visited:
visited.add(node)
# push neighbors in reverse so left-most comes out first
stack.extend()
return visited
🧩 Application: Solve a Maze with BFS / DFS / A*
Set a Source and Target, draw some walls, then try different search algorithms.
🧩 Application: Solve a Maze with BFS / DFS / A*
Set a Source and Target, draw walls, then try different search algorithms.