What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of n vertices?
![]()
(A) A
(B) B
(C) C
(D) D
Answer: (C)
Explanation: Time complexity of Bellman-Ford algorithm is O(VE) where V is number of vertices and E is number of edges. For a complete graph with n vertices, V = n, E = O(n^2). So overall time complexity becomes O(n^3)
Quiz of this Question
Recommended Posts:
- GATE | GATE CS 2013 | Question 1
- GATE | GATE CS 2013 | Question 2
- GATE | GATE CS 2013 | Question 3
- GATE | GATE CS 2013 | Question 4
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 6
- GATE | GATE CS 2013 | Question 7
- GATE | GATE CS 2013 | Question 8
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 11
- GATE | GATE CS 2013 | Question 12
- GATE | GATE CS 2013 | Question 13
- GATE | GATE CS 2013 | Question 14
- GATE | GATE CS 2013 | Question 15
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 17
- GATE | GATE CS 2013 | Question 18
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 65

