Running time of BFS?
Same as for DFS: for exactly the same reason!
Every node gets enqueued, and therefore
explored exactly once
In explore, there is a loop over all adjacent
vertices, giving the same O( degree(v) ) term
? O( |V| + |E| )
Back to first slide
View graphic version