

InterviewSolution
Saved Bookmarks
1. |
Which algorithm efficiently calculates the single source shortest paths in a Directed Acyclic Graph?(a) topological sort(b) hash table(c) binary search(d) radix sortThe question was asked in class test.Query is from Different Path in a Graph in section Graphs of Discrete Mathematics |
Answer» RIGHT option is (a) topological sort The best I can explain: For Directed Acyclic GRAPH, single source SHORTEST DISTANCES can be calculated in O(V+E) time. For that purpose Topological Sorting can be used. Topological Sorting of any graph represents a linear ordering of the graph. |
|