Open In App

GATE | GATE-CS-2005 | Question 38

Like Article
Like
Save
Share
Report

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(| V |2)
(B) O (| E | + | V | log | V |)
(C) O (| V | log | V |)
(D) O ((| E | + | V |) log | V |)


Answer: (D)

Explanation: See Time Complexity Section of https://www.geeksforgeeks.org/greedy-algorithms-set-7-dijkstras-algorithm-for-adjacency-list-representation/

Quiz of this Question


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads