Home »
MCQs »
Algorithms MCQs
In the adjacency matrix representation, the time complexity of Prim's algorithm is ____.
47. In the adjacency matrix representation, the time complexity of Prim's algorithm is ____.
- O(V log E)
- O(V^3)
- O(V^2)
- O(E^2)
Answer
The correct answer is: C) O(V^2)
Explanation
When using an adjacency matrix, the time complexity of Prim's algorithm is O(V^2) due to the need to check all edges for the minimum weight edge selection.