Let G (V, E) an undirected graph with positive edge weights. Dijkstra's single source-shortest path algorithm can be implemented using the binary heap data structure with time complexity?
A
O((|E|+|V|)log|V|)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
O(|V|2)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
O(|V|log|V|)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
O(|E|+|V|log|V|)
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution
The correct option is DO(|E|+|V|log|V|)
Dijkstra's implementation for single source shortest path