1.

What would be the time complexity of the BFS traversal of agraph with n vertices and n^1.25 edges?(a) O(n)(b) O(n^1.25)(c) O(n^2.25)(d) O(n*n)This question is from Adjacency List topic in portion Graph of Data Structures & Algorithms II had been asked this question in semester exam.

Answer»

Correct CHOICE is (b) O(N^1.25)

To EXPLAIN: The TIME complexity for BFS is O(|V| + |E|) = O(n + n^1.25) = O(n^1.25).



Discussion

No Comment Found

Related InterviewSolutions