15 views
The least running time of creating spanning tree from connected graph  in G(E, V) is
1. O (V log V)
2. O (E + V log V)
3. O (E log V)
4. O (V log V + E log V)
Where E, V are respectively number of edges & vertices in the graph.
in Others | 15 views

Though, I feel the question contains insufficient details but still.

The prims algorithm is used when the graph is dense or the number of edges is very high as compared to the number of vertices.

Kruskal is better to be used when the graph is sparse.

Now, coming to the worst case time complexities of both the algorithms.

$PRIMS$ $:$ $O(E + VlogV)$

$KRUSKAL$: $O(ELOGV)$

Since, both of these options are given in the question, then I would chose the Kruskal since, it uses much more simpler data structures in its implementation.

$Kruskal$: Implemented by Union-Find.

$Prims$: Implemented by Fibonacci Heap.

So, answer is (C) according to me.
............................................................................................................
$Note:$ Prims can't be used for disconnected graphs unlike Kruskal.
by Boss (19.3k points)
edited by