161 views

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??

| 161 views
0
unweighted = take each distance ( edge weight ) = 1 unit.

now think how dijkstra's work and bfs work.. U will realize
0

@Shaik Masthan

Dijkstra work on all direction like BFS.

right?? but why not Prims??

Unweighted means no edge weight, then why take each edge weight as 1??

0
I think only for unweighted graph we have to select BFS. dijkstra is for weighted graph