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?
- A. About 10^11
- B. About 10^5
- C. About 10^9
- 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
- Problem: Which statement about Hopcroft-Karp is correct?
- Problem: What does the Gale-Shapley algorithm guarantee for stable matching with n men and n women?
- Problem: How many states does a bitmask DP over subsets of n = 15 items have?
- Problem: Which statement about the Floyd-Warshall algorithm's memory usage for V vertices is correct?
- Problem: Which problem asks for the minimum number of edges to add to make a graph 2-edge-connected?
- Problem: What does 'lazy propagation' in a segment tree guarantee for a range-add update?