Data Structures & AlgorithmsHardICPC regional · graph round

Problem: Dijkstra with a binary heap on a graph with E = 10^6 edges and V = 10^5 vertices runs in roughly how many elementary operations?

  1. A. About 10^11
  2. B. About 10^5
  3. C. About 10^9
  4. D. About 2 * 10^7

Correct answer: D. About 2 * 10^7

E log V is about 10^6 * 17 = 1.7 * 10^7, consistent with the order 2 * 10^7.

More Coding Interview Problems questions

Exams that ask this topic