Computer Science EngineeringHard

Dijkstra's algorithm using a binary heap and adjacency lists runs in

  1. A. O(V^2 log V)
  2. B. O(VE)
  3. C. O(E)
  4. D. O((V+E) log V)

Correct answer: D. O((V+E) log V)

Each edge relaxation may cause a heap update costing log V, plus V extractions.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic