Greedy-approach
October 26, 2023
Operating-Systems
October 26, 2023
Greedy-approach
October 26, 2023
Operating-Systems
October 26, 2023

Greedy-approach

Question 22
The time required to find shortest path in a graph with n vertices and e edges is :
A
O(e)
B
O(n)
C
O(e2)
D
O(n2)
Question 22 Explanation: 
→ We can use dijkstra’s algorithm to find shortest path in a graph with n vertices and e edges is O(ElogV).
→ We know that E ≤ V2 if graph is complete and time complexity is O(n2)
Correct Answer: D
Question 22 Explanation: 
→ We can use dijkstra’s algorithm to find shortest path in a graph with n vertices and e edges is O(ElogV).
→ We know that E ≤ V2 if graph is complete and time complexity is O(n2)
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!