retagged by
1,517 views
0 votes
0 votes

Let $G$ be a graph with $n$ vertices and $m$ edges.What is the tightest upper bound on the running time of Depth First Search of $G$, when $G$ is represented using adjacency matrix?

  1. $O(n)$
  2. $O(m+n)$
  3. $O(n^2)$
  4. $O(mn)$
retagged by

2 Answers

1 votes
1 votes
Option C

Let G be a graph with n vertices and m edges. the tightest upper bound on the running time of Depth First Search of G,

when G is represented as an adjacency matrix=$O(n^{2})$

when G is represented as an adjacency list=$O(n+m)$
Answer:

Related questions

0 votes
0 votes
3 answers
2
admin asked Mar 30, 2020
6,239 views
Which of the following standard algorithms is not Dynamic Programming based?Bellman-Ford Algorithm for single source shortest pathFloyd Warshall Algorithm for all pairs s...
1 votes
1 votes
1 answer
4
admin asked Mar 30, 2020
897 views
Suppose $T(n)=2T(n/2)+n$, $T(0)=T(1)=1$ which one of the following is false?$T(n)=O(n^2)$$T(n)=\Theta(n\log n)$$T(n)=\Omega(n^2)$$T(n)=O(n\log n)$