Data Structures and Algorithms - Performance Analysis of Algorithms and Recurrences

Avatto > > UGC NET COMPUTER SCIENCE > > PRACTICE QUESTIONS > > Data Structures and Algorithms > > Performance Analysis of Algorithms and Recurrences

88. In the following table, the left column contains the names of standard graph algorithms and the right column contains the time complexities of the algorithms. Match each algorithm with its time complexity.

List-IList-II
1.Bellman-Ford algorithmA.O(mlog n)
2.Kruskal's algorithmB.O(n3)
3.Floyd-Warshall algorithmC.O(nm)
4.Topological sortingD.O(n + m)

  • Option : A
  • Explanation :
    Bellman ford = O(n*m)
    Kruskal’s Alqo = O(m logn)
    Floyd war shall = O(n3)
    Topological sort = O(n+m)
Cancel reply
Cancel reply

89. In an unweighted, undirected connected graph, the shortest path from a node S to every other node is computed most efficiently, in terms of time complexity, by

  • Option : D
  • Explanation :
    In case of unweighted, undirected graphs, BFS gives the most time efficient computation for shortest path. It is guaranteed to find first shortest path
Cancel reply
Cancel reply