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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly