From the course: Python Data Structures and Algorithms
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Solution: Trace the path of a depth-first search - Python Tutorial
From the course: Python Data Structures and Algorithms
Solution: Trace the path of a depth-first search
(upbeat music) - [Instructor] And here's the solution to the DFS challenge. So you can see the path is (0,0), (1,0), (2,0), (3,0), (3,1), (3,2), (3,3). If you struggled a bit with this challenge then don't worry, it does take a while to learn this material. I say go back and practice on smaller mazes. Practice on three by three mazes. Watch the video again on tracing DFS inside of a maze on the grid tracer app video, and then come back and try this one again. But if you did succeed, then well done.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Understand the depth-first search algorithm3m 28s
-
(Locked)
Visualize depth-first search on a grid5m 21s
-
(Locked)
Use the Grid Tracer app2m 35s
-
(Locked)
Code a depth-first search in Python12m 10s
-
(Locked)
Challenge: Trace the path of a depth-first search44s
-
(Locked)
Solution: Trace the path of a depth-first search34s
-
(Locked)
-
-
-
-
-