Question discussion

What is the time complexity of Dijkstra’s algorithm for the single source shortest path problem?

358675Medium DSSSB TGT Computer Science 0 replies 0 views
0
What is the time complexity of Dijkstra’s algorithm for the single source shortest path problem?
  • AO(n)
  • BO(log2n)
  • CO(n2)
  • DO(n log2n)
Correct answer: C

Explanation

Dijkstra's algorithm takes O(n²) time when implemented with an adjacency matrix and a simple array to find the minimum.

Discussion 0

Nobody has replied yet. Start the discussion!