Skip to content
Related Articles

Related Articles

GATE | GATE-CS-2005 | Question 38

Improve Article
Save Article
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

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

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!