From the course: Python Data Structures and Algorithms
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Challenge: Trace the path of a depth-first search - Python Tutorial
From the course: Python Data Structures and Algorithms
Challenge: Trace the path of a depth-first search
(upbeat music) - [Instructor] In this challenge, we ask you to trace the path of the DFS algorithm from the start position to the goal position, as shown on the screen. So the start position is in blue and the goal position is in green. A whiteboard is a great tool for doing this, as you can easily erase and update your working as you follow the algorithm. Pencil and paper also works fine, too, or you can use the grid tracer app that we looked at previously. In order to ensure you get the same results as me, make sure you push items onto the stack in a clockwise direction, starting from up, or north. We're not considering diagonals in this course. this challenge should take approximately 10 to 15 minutes to complete.
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)
-
-
-
-
-