CS 3.1. (ALEVEL) - Graph Traversal Flashcards
(2 cards)
1
Q
Depth-first search
A
branch is fully explored before backtracking
-uses stack
- test yourself with example on PMT
2
Q
Breadth-first search
A
-a node is fully explored before venturing onto next node
-uses queue
-only works on connected graph
-useful for determining shortest path
-when queue is empty algorithm terminates
-test yourself with example on PMT