[New 2022] how to use Graph BFS and DFS with pseudocode

preview_player
Показать описание

00:00 introduction
01:49 basically bfs explore adjacent layer by layer using queue
03:38 check if there is next layer
06:38 if the new unvisited vertex is the destination, it must be the shortest path
07:55 practice BFS using diagram
08:09 First Layer
09:00 Second Layer
10:25 Third Layer
11:05 Fourth Layer
11:25 DFS is like building a tree and trace back later (backtracking).

#graph
#adjacent
#AdjacentList
#vertex
#vertices
#edge #bfs #dfs
Рекомендации по теме