Q. What is the time complexity of Dijkstra's algorithm when using a binary heap?
A.
O(V^2)
B.
O(E log V)
C.
O(V log V)
D.
O(E + V)
Solution
When implemented with a binary heap, the time complexity of Dijkstra's algorithm is O(E log V), where E is the number of edges and V is the number of vertices.