Consider the following fragment of code for a graph algorithm on an undirected graph.
for each vertex i in V
mark i as visited
for each edge (j,i) pointing into i
update weight(j,i) to weight(j,i) + k
Which of the following is the most accurate description of the complexity of this fragment. (Recall that n is the number of vertices, m is the number of edges.)
(a) O(n)
(b)O(nm)
(c)O(n+m)
(d)O(m)