...
Greedy-approach
October 26, 2023
TIFR PHD 2022
October 26, 2023
Greedy-approach
October 26, 2023
TIFR PHD 2022
October 26, 2023

Greedy-approach

Question 11
Which of the following algorithms is fastest to find shortest path from a source node to a destination node in an un-weighted connected graph?
A
Warshall’s algorithm
B
Floyd’s algorithm
C
Breadth First Traversal
D
Depth First Traversal
Question 11 Explanation: 
warshall algorithm will take O(n^3) time.
Floyd’s algorithm will take O(n^3) time.
Breadth First traversal will take O(m+n) time.
Depth first traversal will work only if the graph is tree.
Hence among the given options Breadth first traversal is best.
Correct Answer: C
Question 11 Explanation: 
warshall algorithm will take O(n^3) time.
Floyd’s algorithm will take O(n^3) time.
Breadth First traversal will take O(m+n) time.
Depth first traversal will work only if the graph is tree.
Hence among the given options Breadth first traversal is best.
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!!