Question: A directed graph is n vertices and e edges is given. Estimate the average time spent on a single call of the recursive version of

A directed graph is n vertices and e edges is given. Estimate the average time spent on a single call of the recursive version of dfs in terms of n and e. Assume that the graph is represented in terms of adjacency lists. Justify your answer.

for v := 1 to n do mark[v] := unvisited; for v := 1 to n do if mark[v] = unvisited then dfs(v)

procedure dfs(v: vertex); var w: vertex; begin mark[v] := visited; for each w in L[v] do if mark[w] = unvisited then dfs(w) end;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!