Depth-First Search Algorithm: Graph or Tree traversal and search

preview_player
Показать описание
The Depth-First Search algorithm is a traversal or search algorithm used with graph or tree data structures. It has an efficiency of O(|V| + |E|) and is distinguished from the breadth-first search algorithm by it's use of a stack data structure to support it's backtracking behavior.

It is a simple, yet effective algorithm with many applications.

In this video, I introduce the algorithm and provide an animated example of the algorithm's traversal in action.

// Consider supporting this channel in multiple ways
Bitcoin: 177wfkQwzXiC8o2whQMVpSyuWUs95krKYB
Рекомендации по теме
Комментарии
Автор

There is a case: a vertex could be pushed to the stack for multiple times, maybe we can mark the vertex as visited when it enters the stack or when push vertex into the stack, we should check if it's already in the stack

jordanwang
Автор

Hi what video should I watch after the beginner c++ video?

bayankhatib
visit shbcf.ru