31251 Lecture 9.3: Depth-first search

preview_player
Показать описание
We begin by discussing the kinds of connectivity problems that depth-first search can be used to solve. We compare depth-first search to how you might try to find your way out of a maze with a ball of string and a piece of chalk. Then we go over a detailed example of the execution of a recursive version of depth-first search. Next we show that depth-first search finds connected components and analyse its running time. Finally we discuss an iterative version of depth-first search using a stack data structure.

Links to code:
Рекомендации по теме