245 views
0 votes
0 votes
Let G = (V, E) with |V | = n and |E| = m. What is the worst-case complexity of:

(a) BFS using an adjacency matrix representation of G. O($n^2$ )

(b) BFS using an adjacency list representation of G. O(n + m)

(c) DFS using an adjacency matrix representation of G. O($n^2$ )

(d) DFS using an adjacency list representation of G. O(n + m)

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
1
rsansiya111 asked Dec 8, 2021
232 views
How much time will it take to evaluate this recursive definition using dynamic programming?(a) O(n)(b) O(n log n)(c) O($n^2$ )(d) O($n^3$ )
1 votes
1 votes
1 answer
3
rsansiya111 asked Dec 7, 2021
350 views
The number of possible subsequences in a string of length n are:$n^{2}$$2^{n}$ n!n(n-1)
2 votes
2 votes
1 answer
4
rsansiya111 asked Dec 8, 2021
871 views
Suppose we do merge sort with a three-way split: divide the array into 3 equal parts, sort each part and do a 3 way merge.What would the worst-case complexity of this ver...