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)
πŸ’¬ Discuss
βœ… Correct 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.

Explanation by: Mr. Dubey
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

πŸ“Š Question Analytics

πŸ‘οΈ
466
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
86%
Success Rate