1. Computer Science Engineering (CSE)
  2. Design and Analysis of Algorithms
  3. Worst case is the worst case time comple...
Q.

Worst case is the worst case time complexity of Prim’s algorithm if adjacency matrix is used?

A. o(log v)
B. o(v2)
C. o(e2)
D. o(v log e)
Answer» B. o(v2)
Explanation: use of adjacency matrix provides the simple implementation of the prim’s algorithm. in prim’s algorithm, we need to search for the edge with a minimum for that vertex. so, worst case time complexity will be o(v2), where v is the number of vertices.

Discussion