553 views
2 votes
2 votes
The problem of finding the set of vertices reachable from a given vertex in a graph can be solved in time

A. O(|V|^2)

B. O(|V| + |E|)

C. O(|V||E|)

D. none of these

1 Answer

0 votes
0 votes
B) O (V+E)

Perform BFS

Related questions

0 votes
0 votes
0 answers
3
iarnav asked Apr 19, 2018
418 views
Some say answer is 2n and someplace else it's been told 2n-1-1. So, what's the corrent one?
2 votes
2 votes
1 answer
4