Exam 1 Flashcards
1
Q
Depth first search algorithm steps
A
Start at origin vertex
– if no valid neighbors, return failure
– for each vertex reachable from the current vertex,
recursively search using that neighbor as the origin
– stop as soon as a recursive search is successful, and return success
– if none of the recursive calls was successful, return failure
2
Q
BFS algorithm
A