Please explain me time complexity of Dijkstra’s Algorithm
code:https://ide.codingblocks.com/s/39846
Time Complexity-Dijkstra Algorithm
Hey Shrey,
Initialization : O(|V|)
While loop O(|V|)
Find and remove min distance vertices O(log |V|)
Potentially |E| updates O(log |V|) times
So,
Total time O(|V| log|V| + |E| log|V|) = O(|E| log|V|)
2 Likes