Graph Search: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 2: | Line 2: | ||
* [[Graphs#Subjects|Graphs]] | * [[Graphs#Subjects|Graphs]] | ||
=Overview= | =Overview= | ||
Both breadth-first search and depth-first search algorithms are very efficient, in that they walk the entire graph in linear time of the number of vertices and edges O(n + m). | |||
=<span id='BFS'></span>Breadth-First Search (BFS)= | =<span id='BFS'></span>Breadth-First Search (BFS)= | ||
=<span id='DFS'></span>Depth-First Search (DFS)= | =<span id='DFS'></span>Depth-First Search (DFS)= |
Revision as of 19:16, 1 October 2021
Internal
Overview
Both breadth-first search and depth-first search algorithms are very efficient, in that they walk the entire graph in linear time of the number of vertices and edges O(n + m).