GATE IT 2005 · Graph Traversals (BFS & DFS)

MCQ · 1 mark · Problem PROG-GRPH-0110

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.\[\begin{array}{|ll|ll|}\hline \text{1.} & \text{Bellman-Ford algorithm} & \text{A:} & \text{$O(m\log n)$} \\\hline \text{2.} & \text{Kruskal's algorithm} & \text{B:}& \text{$O(n^3)$} \\\hline \text{3.}& \text{Floyd-Warshall algorithm} & \text{C:} & \text{$O(nm)$} \\\hline \text{4.} & \text{Topological sorting} &\text{D:} & \text{$O(n+m)$} \\\hline \end{array}\]
  1. A
    1\(\rightarrow\) C, 2 \(\rightarrow\) A, 3 \(\rightarrow\) B, 4 \(\rightarrow\) D
  2. B
    1\(\rightarrow\) B, 2 \(\rightarrow\) D, 3 \(\rightarrow\) C, 4 \(\rightarrow\) A
  3. C
    1\(\rightarrow\) C, 2 \(\rightarrow\) D, 3 \(\rightarrow\) A, 4 \(\rightarrow\) B
  4. D
    1\(\rightarrow\) B, 2 \(\rightarrow\) A, 3 \(\rightarrow\) C, 4 \(\rightarrow\) D

Solve it on GATE DA practice →More Graph Theory & Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/3760/gate2005-it-15

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com