Home »
MCQs »
Algorithms MCQs
The complexity of Prim's algorithm when using an adjacency list and a binary heap is ____.
44. The complexity of Prim's algorithm when using an adjacency list and a binary heap is ____.
- O(V^2)
- O(E log V)
- O(E + V)
- O(V log E)
Answer
The correct answer is: B) O(E log V)
Explanation
When using an adjacency list with a binary heap, Prim's algorithm runs in O(E log V) time.