Computer Science EngineeringHard
The Bellman-Ford single-source shortest path algorithm has running time
- A. O(V^2)
- B. O(E log V)
- C. O(VE)
- D. O(V+E)
Correct answer: C. O(VE)
It relaxes all E edges in each of V-1 passes.
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- What is the Theta bound of: for(i=1;i<=n;i++) for(j=i;j<=n;j+=i) count++;
- The recurrence T(n) = 4T(n/2) + n^2 has solution
- The time complexity of topological sorting of a DAG with V vertices and E edges using DFS is
- Which of the following standard sorting algorithms is stable?
- In a max-heap, the largest element is always located at
- A simple undirected graph has 10 vertices and exactly 3 connected components. What is the maximum possible number of edges?