closed by
839 views
2 votes
2 votes
closed as a duplicate of: Dijkstra

Which of the following procedure results same output as Dijkstra’s Algo. on unweighted graph on $'n'$ verices?

$A)$ BFS  $B)$ DFS   $C)$Kruskal  $D)$ Prims


As far I know Dijkstra and Prims both have $T.C.=O(E+VlogV)$

But ans given BFS.

How this ans possible??

closed by

1 Answer

Best answer
1 votes
1 votes
BFS when apply on an unweighted graph , In the resultant BFS tree it can be seen that the shortest path to every vertex from root (or the start vertex) is figured out.

It is quite similar to dijsktra algorithm which is also single source shortest path.
selected by

Related questions

1 votes
1 votes
1 answer
1
srestha asked Jan 16, 2017
834 views
Which of the following procedure results same output as Dijkstra’s algorithm on unweighted graph with ‘n’ vertices ?a) BFSb) DFSc) Kruskald) Prims
1 votes
1 votes
3 answers
2
ankit_thawal asked Jan 25, 2018
1,570 views
I think answer should be Option(B).Path:<s,y><y,x><x,t = 7-3-2=2
0 votes
0 votes
0 answers
3
Elaf asked Jan 22, 2023
316 views
0 votes
0 votes
0 answers
4
gate20232 asked Jan 18, 2023
479 views